Skip to content

Commit 4cfa862

Browse files
committed
Restore UnsealedAttributeAccess elevation to error in tests.
1 parent b2f199a commit 4cfa862

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

tests/test_query.py

+5
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import pickle
2+
import warnings
23

34
from django.apps import apps
45
from django.contrib.contenttypes.models import ContentType
@@ -49,6 +50,10 @@ def setUpTestData(cls):
4950
tests_models = tuple(apps.get_app_config("tests").get_models())
5051
ContentType.objects.get_for_models(*tests_models, for_concrete_models=True)
5152

53+
def setUp(self):
54+
warnings.filterwarnings("error", category=UnsealedAttributeAccess)
55+
self.addCleanup(warnings.resetwarnings)
56+
5257
def test_state_sealed_assigned(self):
5358
instance = SeaLion.objects.seal().get()
5459
self.assertTrue(instance._state.sealed)

0 commit comments

Comments
 (0)