1
0
mirror of https://github.com/django/django.git synced 2025-10-24 14:16: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

@@ -1,8 +1,11 @@
from django.db.models.base import ModelState, ModelStateFieldsCacheDescriptor
from django.db.models.base import ModelState, ModelStateCacheDescriptor
from django.test import SimpleTestCase
class ModelStateTests(SimpleTestCase):
def test_fields_cache_descriptor(self):
self.assertIsInstance(ModelState.fields_cache, ModelStateFieldsCacheDescriptor)
self.assertIsInstance(ModelState.fields_cache, ModelStateCacheDescriptor)
def test_related_managers_descriptor(self):
self.assertIsInstance(ModelState.related_managers_cache, ModelStateCacheDescriptor)