diff options
| author | Hasan Ramezani <hasan.r67@gmail.com> | 2019-09-27 12:16:26 +0200 |
|---|---|---|
| committer | Mariusz Felisiak <felisiak.mariusz@gmail.com> | 2019-09-27 14:22:31 +0200 |
| commit | 95a11578ce41de1e152fe7d173f109e280aebd6d (patch) | |
| tree | cb028ad12c6bd88660285a81b94b8839b07d580b /tests/invalid_models_tests | |
| parent | c7944628a1979453468d67818c63957532d396d8 (diff) | |
Fixed #30798 -- Fixed Meta.ordering validation for pk of related fields.
Regression in 440505cb2cadbe1a5b9fba246bcde6c04f51d07e.
Diffstat (limited to 'tests/invalid_models_tests')
| -rw-r--r-- | tests/invalid_models_tests/test_models.py | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/tests/invalid_models_tests/test_models.py b/tests/invalid_models_tests/test_models.py index 02db3ea54a..60b89b6f2e 100644 --- a/tests/invalid_models_tests/test_models.py +++ b/tests/invalid_models_tests/test_models.py @@ -844,6 +844,18 @@ class OtherModelTests(SimpleTestCase): with register_lookup(models.CharField, Lower): self.assertEqual(Model.check(), []) + def test_ordering_pointing_to_related_model_pk(self): + class Parent(models.Model): + pass + + class Child(models.Model): + parent = models.ForeignKey(Parent, models.CASCADE) + + class Meta: + ordering = ('parent__pk',) + + self.assertEqual(Child.check(), []) + def test_ordering_pointing_to_foreignkey_field(self): class Parent(models.Model): pass |
