summaryrefslogtreecommitdiff
path: root/tests/postgres_tests/test_array.py
diff options
context:
space:
mode:
authorMariusz Felisiak <felisiak.mariusz@gmail.com>2020-12-03 09:30:33 +0100
committerGitHub <noreply@github.com>2020-12-03 09:30:33 +0100
commitd746f28949c009251a8741ba03d156964050717f (patch)
treed2341d5ea529ca1fccc57856e04b7a1eb115495f /tests/postgres_tests/test_array.py
parent48b4bae983a1f9a73624fe62ef5bd1130b0dba39 (diff)
downloaddjango-d746f28949c009251a8741ba03d156964050717f.tar.gz
Refs #27095 -- Fixed test_contained_by_including_F_object when run in reverse.
Tests should not rely on auto PKs. Test regression in 33403bf80f635577a18426bc99c8a65e31fd8dfa.
Diffstat (limited to 'tests/postgres_tests/test_array.py')
-rw-r--r--tests/postgres_tests/test_array.py12
1 files changed, 6 insertions, 6 deletions
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],
)