Ticket #16134: 16134_fix.diff
File 16134_fix.diff, 1.3 KB (added by , 13 years ago) |
---|
-
tests/regressiontests/model_fields/tests.py
23 23 24 24 25 25 class BasicFieldTests(test.TestCase): 26 def test_field_can_compare_null(self): 27 """ 28 Regression test for #16134. Checks to see if a field can be compared with None. 29 """ 30 field = models.Field() 31 32 self.assertNotEqual(field,None) 33 self.assertNotEqual(cmp(field,None),0) 34 26 35 def test_show_hidden_initial(self): 27 36 """ 28 37 Regression test for #12913. Make sure fields with choices respect -
django/db/models/fields/__init__.py
117 117 self.error_messages = messages 118 118 119 119 def __cmp__(self, other): 120 if not hasattr(other, 'creation_counter'): 121 return super(self).cmp(self, other) 120 122 # This is needed because bisect does not take a comparison function. 121 123 return cmp(self.creation_counter, other.creation_counter) 122 124