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:
committed by
Mariusz Felisiak
parent
ba9ced3e9a
commit
4f8c7fd9d9
@@ -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):
|
||||
"""
|
||||
|
||||
Reference in New Issue
Block a user