mirror of
https://github.com/django/django.git
synced 2025-10-27 15:46:10 +00:00
Fixed #35614 -- Prevented SQLCompiler.as_subquery_condition() from mutating a query.
This commit is contained in:
committed by
Sarah Boyce
parent
b21f6d7ee4
commit
bdd538488c
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user