From d746f28949c009251a8741ba03d156964050717f Mon Sep 17 00:00:00 2001 From: Mariusz Felisiak Date: Thu, 3 Dec 2020 09:30:33 +0100 Subject: Refs #27095 -- Fixed test_contained_by_including_F_object when run in reverse. Tests should not rely on auto PKs. Test regression in 33403bf80f635577a18426bc99c8a65e31fd8dfa. --- tests/postgres_tests/test_array.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'tests/postgres_tests/test_array.py') diff --git a/tests/postgres_tests/test_array.py b/tests/postgres_tests/test_array.py index 3c7584e84c..6fb34b3d92 100644 --- a/tests/postgres_tests/test_array.py +++ b/tests/postgres_tests/test_array.py @@ -205,11 +205,11 @@ class TestQuerying(PostgreSQLTestCase): @classmethod def setUpTestData(cls): cls.objs = NullableIntegerArrayModel.objects.bulk_create([ - NullableIntegerArrayModel(field=[1]), - NullableIntegerArrayModel(field=[2]), - NullableIntegerArrayModel(field=[2, 3]), - NullableIntegerArrayModel(field=[20, 30, 40]), - NullableIntegerArrayModel(field=None), + NullableIntegerArrayModel(order=1, field=[1]), + NullableIntegerArrayModel(order=2, field=[2]), + NullableIntegerArrayModel(order=3, field=[2, 3]), + NullableIntegerArrayModel(order=4, field=[20, 30, 40]), + NullableIntegerArrayModel(order=5, field=None), ]) def test_empty_list(self): @@ -304,7 +304,7 @@ class TestQuerying(PostgreSQLTestCase): def test_contained_by_including_F_object(self): self.assertSequenceEqual( - NullableIntegerArrayModel.objects.filter(field__contained_by=[models.F('id'), 2]), + NullableIntegerArrayModel.objects.filter(field__contained_by=[models.F('order'), 2]), self.objs[:3], ) -- cgit v1.3