summaryrefslogtreecommitdiff
path: root/tests/model_fields
diff options
context:
space:
mode:
authorSimon Charette <charette.s@gmail.com>2024-08-09 12:55:40 -0400
committernessita <124304+nessita@users.noreply.github.com>2024-08-28 11:44:05 -0300
commit39abd56a7fb1e2f735040df0fdfc08f57d91a49b (patch)
treea4a4cccf2ac39d0aa9c26512f4fcb6f34261f178 /tests/model_fields
parent47f18a722624527cc72eef44cfc9d1e07ea4b4e0 (diff)
Refs #35405 -- Adjusted deprecation warning stacklevel in FieldCacheMixin.get_cache_name().
Diffstat (limited to 'tests/model_fields')
-rw-r--r--tests/model_fields/test_mixins.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/tests/model_fields/test_mixins.py b/tests/model_fields/test_mixins.py
index 5ccfac4d78..8847f25987 100644
--- a/tests/model_fields/test_mixins.py
+++ b/tests/model_fields/test_mixins.py
@@ -34,9 +34,10 @@ class FieldCacheMixinTests(SimpleTestCase):
# RemovedInDjango60Warning.
def test_get_cache_name_deprecated(self):
msg = "Override ExampleOld.cache_name instead of get_cache_name()."
- with self.assertWarnsMessage(RemovedInDjango60Warning, msg):
+ with self.assertWarnsMessage(RemovedInDjango60Warning, msg) as ctx:
result = ExampleOld().cache_name
self.assertEqual(result, "example")
+ self.assertEqual(ctx.filename, __file__)
def test_cache_name(self):
result = Example().cache_name