Dictionaries compare equal if they contain the same data, regardless of key order. There is no need to convert to sorted sequences unless you need to compare the serialized output (such as in doctests).
I would guess that one of the models has additional fields added to its __dict__, perhaps through some caching mechanism. Try printing ``vars(mo)`` and ``vars(saved_mo)``, and then examine the output manually. If you truly wish to examine two model objects for equality, you could try the appended code[1] However, I would advise that you remove your test entirely. It is without point, as Django's unit testing already covers the behavior of ``Model.send()``. Restrict testing to your own code, before you go mad "sanity checking" the massive pile of third-party code underlying yours. [1] -------------------------- assertEqual (type (mo), type (saved_mo)) # Retrieve a list of database model field names attrs = [f.attname for f in mo._meta.fields] # Construct lists based on the model attributes, and compare them mo_attrs = [getattr (mo, a) for a in attrs] saved_mo_attrs = [getattr (saved_mo, a) for a in attrs] assertEqual (mo_attrs, saved_mo_attrs) -------------------------- --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~----------~----~----~----~------~----~------~--~---