summaryrefslogtreecommitdiff
path: root/tests/foreign_object
diff options
context:
space:
mode:
Diffstat (limited to 'tests/foreign_object')
-rw-r--r--tests/foreign_object/tests.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/tests/foreign_object/tests.py b/tests/foreign_object/tests.py
index c9e8da5792..2d3aa800f7 100644
--- a/tests/foreign_object/tests.py
+++ b/tests/foreign_object/tests.py
@@ -223,6 +223,13 @@ class MultiColumnFKTests(TestCase):
[m2],
)
+ def test_query_does_not_mutate(self):
+ """
+ Recompiling the same subquery doesn't mutate it.
+ """
+ queryset = Friendship.objects.filter(to_friend__in=Person.objects.all())
+ self.assertEqual(str(queryset.query), str(queryset.query))
+
def test_select_related_foreignkey_forward_works(self):
Membership.objects.create(
membership_country=self.usa, person=self.bob, group=self.cia