From 440505cb2cadbe1a5b9fba246bcde6c04f51d07e Mon Sep 17 00:00:00 2001 From: Hasan Ramezani Date: Fri, 1 Mar 2019 17:09:33 +0100 Subject: Fixed #29408 -- Added validation of related fields and lookups in model Meta.ordering. --- tests/postgres_tests/test_json.py | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'tests/postgres_tests') 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() -- cgit v1.3