summaryrefslogtreecommitdiff
path: root/tests/invalid_models_tests
diff options
context:
space:
mode:
authorMariusz Felisiak <felisiak.mariusz@gmail.com>2020-05-05 09:08:29 +0200
committerGitHub <noreply@github.com>2020-05-05 09:08:29 +0200
commitb73e66e75802f10cc34d4880714554cea54dbf49 (patch)
tree34ba3bcd57d02535c72731c4ab67ae8f584cc1eb /tests/invalid_models_tests
parentd2b9a9fdbbc9b5e19b22b144d3e305b87c03b6c8 (diff)
Fixed #31538 -- Fixed Meta.ordering validation lookups that are not transforms.
Regression in 440505cb2cadbe1a5b9fba246bcde6c04f51d07e. Thanks Simon Meers for the report.
Diffstat (limited to 'tests/invalid_models_tests')
-rw-r--r--tests/invalid_models_tests/test_models.py9
1 files changed, 9 insertions, 0 deletions
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