summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/backends/tests.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/tests/backends/tests.py b/tests/backends/tests.py
index 4bab62aebb..2adfa51360 100644
--- a/tests/backends/tests.py
+++ b/tests/backends/tests.py
@@ -558,8 +558,9 @@ class BackendTestCase(TransactionTestCase):
"Limit for query logging exceeded, only the last 3 queries will be "
"returned."
)
- with self.assertWarnsMessage(UserWarning, msg):
+ with self.assertWarnsMessage(UserWarning, msg) as ctx:
self.assertEqual(3, len(new_connection.queries))
+ self.assertEqual(ctx.filename, __file__)
finally:
BaseDatabaseWrapper.queries_limit = old_queries_limit