[Django]-AssertEqual fails even though the values are the same in python/django

7👍

Look at the error message: name[0] is a unicode string and Test.id is a UUID. They have the same representation but are different objects. To test equality simply convert one object to the type of the other:

self.assertEqual(name[0], str(Test.id))
👤Daniel

Leave a comment