summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorMariusz Felisiak <felisiak.mariusz@gmail.com>2020-05-05 09:08:29 +0200
committerMariusz Felisiak <felisiak.mariusz@gmail.com>2020-05-05 09:09:17 +0200
commitfdd5eb4309535bf49b3138e0954c6da553c1adef (patch)
treede33236d3825b9d98ffce61fc6d29c4ddb5b0660 /tests
parent883362b6a793ff337c9314c03716c2e12c69d4d8 (diff)
downloaddjango-fdd5eb4309535bf49b3138e0954c6da553c1adef.tar.gz
[3.0.x] Fixed #31538 -- Fixed Meta.ordering validation lookups that are not transforms.
Regression in 440505cb2cadbe1a5b9fba246bcde6c04f51d07e. Thanks Simon Meers for the report. Backport of b73e66e75802f10cc34d4880714554cea54dbf49 from master
Diffstat (limited to '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 60b89b6f2e..8a204162d3 100644
--- a/tests/invalid_models_tests/test_models.py
+++ b/tests/invalid_models_tests/test_models.py
@@ -844,6 +844,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