1
0
mirror of https://github.com/django/django.git synced 2025-10-24 06:06:09 +00:00

Fixed #32980 -- Made models cache related managers.

This commit is contained in:
Keryn Knight
2021-08-01 12:13:35 +01:00
committed by Mariusz Felisiak
parent ba9ced3e9a
commit 4f8c7fd9d9
10 changed files with 173 additions and 13 deletions

View File

@@ -1147,6 +1147,14 @@ class ForeignKeyToFieldTest(TestCase):
]
)
def test_m2m_manager_reused(self):
author = Author.objects.prefetch_related(
'favorite_authors',
'favors_me',
).first()
self.assertIs(author.favorite_authors, author.favorite_authors)
self.assertIs(author.favors_me, author.favors_me)
class LookupOrderingTest(TestCase):
"""