From f69c7bbdceba43789bfba935dd8fa3daaa7f36c4 Mon Sep 17 00:00:00 2001 From: Mariusz Felisiak Date: Fri, 1 Mar 2019 19:38:21 +0100 Subject: Refs #29408 -- Cosmetic edits for validation of related fields and lookups in model Meta.ordering. Follow up to 440505cb2cadbe1a5b9fba246bcde6c04f51d07e. --- tests/invalid_models_tests/test_models.py | 17 ++++++++++------- tests/postgres_tests/test_json.py | 2 +- 2 files changed, 11 insertions(+), 8 deletions(-) (limited to 'tests') diff --git a/tests/invalid_models_tests/test_models.py b/tests/invalid_models_tests/test_models.py index 320e799a6e..6b57dd7d9d 100644 --- a/tests/invalid_models_tests/test_models.py +++ b/tests/invalid_models_tests/test_models.py @@ -632,7 +632,8 @@ class OtherModelTests(SimpleTestCase): self.assertEqual(Model.check(), [ Error( - "'ordering' refers to the nonexistent field 'relation'.", + "'ordering' refers to the nonexistent field, related field, " + "or lookup 'relation'.", obj=Model, id='models.E015', ), @@ -645,7 +646,8 @@ class OtherModelTests(SimpleTestCase): self.assertEqual(Model.check(), [ Error( - "'ordering' refers to the nonexistent field 'missing_field'.", + "'ordering' refers to the nonexistent field, related field, " + "or lookup 'missing_field'.", obj=Model, id='models.E015', ) @@ -660,7 +662,8 @@ class OtherModelTests(SimpleTestCase): self.assertEqual(Model.check(), [ Error( - "'ordering' refers to the nonexistent field 'missing_fk_field_id'.", + "'ordering' refers to the nonexistent field, related field, " + "or lookup 'missing_fk_field_id'.", obj=Model, id='models.E015', ) @@ -675,7 +678,7 @@ class OtherModelTests(SimpleTestCase): self.assertEqual(Model.check(), [ Error( - "'ordering' refers to the nonexistent field, related field " + "'ordering' refers to the nonexistent field, related field, " "or lookup 'missing_related__id'.", obj=Model, id='models.E015', @@ -694,7 +697,7 @@ class OtherModelTests(SimpleTestCase): self.assertEqual(Child.check(), [ Error( - "'ordering' refers to the nonexistent field, related field " + "'ordering' refers to the nonexistent field, related field, " "or lookup 'parent__missing_field'.", obj=Child, id='models.E015', @@ -710,7 +713,7 @@ class OtherModelTests(SimpleTestCase): self.assertEqual(Child.check(), [ Error( - "'ordering' refers to the nonexistent field, related field " + "'ordering' refers to the nonexistent field, related field, " "or lookup 'parent__missing_field'.", obj=Child, id='models.E015', @@ -732,7 +735,7 @@ class OtherModelTests(SimpleTestCase): self.assertEqual(Child.check(), [ Error( - "'ordering' refers to the nonexistent field, related field " + "'ordering' refers to the nonexistent field, related field, " "or lookup 'parent1__parent2__missing_field'.", obj=Child, id='models.E015', diff --git a/tests/postgres_tests/test_json.py b/tests/postgres_tests/test_json.py index e95939be16..ca164a81ba 100644 --- a/tests/postgres_tests/test_json.py +++ b/tests/postgres_tests/test_json.py @@ -19,7 +19,7 @@ except ImportError: pass -class TestModelMetaOrdering(PostgreSQLTestCase): +class TestModelMetaOrdering(PostgreSQLSimpleTestCase): def test_ordering_by_json_field_value(self): class TestJSONModel(JSONModel): class Meta: -- cgit v1.3