1
0
mirror of https://github.com/django/django.git synced 2025-10-31 09:41:08 +00:00

Fixed #33984 -- Reverted "Fixed #32980 -- Made models cache related managers."

This reverts 4f8c7fd9d9 and adds
two regression tests:
- test_related_manager_refresh(), and
- test_create_copy_with_m2m().

Thanks joeli for the report.
This commit is contained in:
Mariusz Felisiak
2022-09-30 18:18:33 +02:00
committed by GitHub
parent 6cc0f22a73
commit 5e0aa362d9
12 changed files with 47 additions and 176 deletions

View File

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