From b73e66e75802f10cc34d4880714554cea54dbf49 Mon Sep 17 00:00:00 2001 From: Mariusz Felisiak Date: Tue, 5 May 2020 09:08:29 +0200 Subject: Fixed #31538 -- Fixed Meta.ordering validation lookups that are not transforms. Regression in 440505cb2cadbe1a5b9fba246bcde6c04f51d07e. Thanks Simon Meers for the report. --- tests/invalid_models_tests/test_models.py | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'tests') diff --git a/tests/invalid_models_tests/test_models.py b/tests/invalid_models_tests/test_models.py index 6bfdf2e736..5a1bb4cc7a 100644 --- a/tests/invalid_models_tests/test_models.py +++ b/tests/invalid_models_tests/test_models.py @@ -893,6 +893,15 @@ class OtherModelTests(SimpleTestCase): with register_lookup(models.CharField, Lower): self.assertEqual(Model.check(), []) + def test_ordering_pointing_to_lookup_not_transform(self): + class Model(models.Model): + test = models.CharField(max_length=100) + + class Meta: + ordering = ('test__isnull',) + + self.assertEqual(Model.check(), []) + def test_ordering_pointing_to_related_model_pk(self): class Parent(models.Model): pass -- cgit v1.3