diff options
Diffstat (limited to 'tests/model_fields')
| -rw-r--r-- | tests/model_fields/tests.py | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/tests/model_fields/tests.py b/tests/model_fields/tests.py index 85e2825165..f7faf399c7 100644 --- a/tests/model_fields/tests.py +++ b/tests/model_fields/tests.py @@ -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): |
