summaryrefslogtreecommitdiff
path: root/tests/postgres_tests
diff options
context:
space:
mode:
authorHasan Ramezani <hasan.r67@gmail.com>2019-03-01 17:09:33 +0100
committerMariusz Felisiak <felisiak.mariusz@gmail.com>2019-03-01 17:09:33 +0100
commit440505cb2cadbe1a5b9fba246bcde6c04f51d07e (patch)
treeefa7f88f683ecf7246a06600dd677b832c326e7b /tests/postgres_tests
parent4dcbe6eb2de38a856dae39928692e46fbcf5c475 (diff)
Fixed #29408 -- Added validation of related fields and lookups in model Meta.ordering.
Diffstat (limited to 'tests/postgres_tests')
-rw-r--r--tests/postgres_tests/test_json.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/tests/postgres_tests/test_json.py b/tests/postgres_tests/test_json.py
index 6622820ec9..e95939be16 100644
--- a/tests/postgres_tests/test_json.py
+++ b/tests/postgres_tests/test_json.py
@@ -19,6 +19,15 @@ except ImportError:
pass
+class TestModelMetaOrdering(PostgreSQLTestCase):
+ def test_ordering_by_json_field_value(self):
+ class TestJSONModel(JSONModel):
+ class Meta:
+ ordering = ['field__value']
+
+ self.assertEqual(TestJSONModel.check(), [])
+
+
class TestSaveLoad(PostgreSQLTestCase):
def test_null(self):
instance = JSONModel()