summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-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