mirror of
https://github.com/django/django.git
synced 2025-10-23 21:59:11 +00:00
Moved test_field_ordering to the model_fields package.
This commit is contained in:
committed by
Tim Graham
parent
92c5eeac33
commit
adb791fdcb
@@ -59,6 +59,16 @@ class BasicFieldTests(TestCase):
|
||||
f = Foo._meta.get_field('a')
|
||||
self.assertEqual(force_str(f), 'model_fields.Foo.a')
|
||||
|
||||
def test_field_ordering(self):
|
||||
"""Fields are ordered based on their creation."""
|
||||
f1 = models.Field()
|
||||
f2 = models.Field(auto_created=True)
|
||||
f3 = models.Field()
|
||||
self.assertLess(f2, f1)
|
||||
self.assertGreater(f3, f1)
|
||||
self.assertIsNotNone(f1)
|
||||
self.assertNotIn(f2, (None, 1, ''))
|
||||
|
||||
|
||||
class ChoicesTests(SimpleTestCase):
|
||||
|
||||
|
||||
Reference in New Issue
Block a user