summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorAnssi Kääriäinen <akaariai@gmail.com>2015-07-20 13:35:24 +0300
committerTim Graham <timograham@gmail.com>2015-07-20 10:20:21 -0400
commit6a9a9e50f233b3ba4af13bf2dc664dfa3b12038d (patch)
treea10e77e44f92fdfcdc5683c1822c269b01b8768e /tests
parent6e3fe089dd4461731149f3621e61b831bf3c0db7 (diff)
Fixed test with incorrect assumption about pk values.
The test results were dependent on the order in which the tests were run.
Diffstat (limited to 'tests')
-rw-r--r--tests/queries/tests.py9
1 files changed, 8 insertions, 1 deletions
diff --git a/tests/queries/tests.py b/tests/queries/tests.py
index 36579937f4..26b9b1eb32 100644
--- a/tests/queries/tests.py
+++ b/tests/queries/tests.py
@@ -3524,8 +3524,15 @@ class RelatedLookupTypeTests(TestCase):
"""
#23396 - Ensure ValueQuerySets are not checked for compatibility with the lookup field
"""
+ # Make sure the num and objecta field values match.
+ ob = ObjectB.objects.get(name='ob')
+ ob.num = ob.objecta.pk
+ ob.save()
+ pob = ObjectB.objects.get(name='pob')
+ pob.num = pob.objecta.pk
+ pob.save()
self.assertQuerysetEqual(ObjectB.objects.filter(
- objecta__in=ObjectB.objects.all().values_list('pk')
+ objecta__in=ObjectB.objects.all().values_list('num')
).order_by('pk'), ['<ObjectB: ob>', '<ObjectB: pob>'])