def test_equal_notequal_hash(self):
            # Create two Persons with different mugshots.
            p1 = self.PersonModel(name="Joe")
            p1.mugshot.save("mug", self.file1)
            p2 = self.PersonModel(name="Bob")
            p2.mugshot.save("mug", self.file2)
            self.assertEqual(p1.mugshot == p2.mugshot, False)
            self.assertEqual(p1.mugshot != p2.mugshot, True)

            # Test again with an instance fetched from the db.
            p1_db = self.PersonModel.objects.get(name="Joe")
            self.assertEqual(p1_db.mugshot == p2.mugshot, False)
            self.assertEqual(p1_db.mugshot != p2.mugshot, True)

            # Instance from db should match the local instance.
            self.assertEqual(p1_db.mugshot == p1.mugshot, True)
            self.assertEqual(hash(p1_db.mugshot), hash(p1.mugshot))
            self.assertEqual(p1_db.mugshot != p1.mugshot, False)
Bug #9786: Ensure '==' and '!=' work correctly.
dataset/ETHPy150Open AppScale/appscale/AppServer/lib/django-1.2/tests/regressiontests/model_fields/imagefield.py/ImageFieldTests.test_equal_notequal_hash