* status: new => assigned
* needs_better_patch: 0 => 1
* needs_tests: 0 => 1
* owner: nobody => Arian
* has_patch: 0 => 1
* stage: Unreviewed => Accepted
Comment:
Thanks for the report, I was able to reproduce it with the following test:
{{{!diff
diff --git a/tests/test_utils/tests.py b/tests/test_utils/tests.py
index cdb0453e44..b0eb0b0f83 100644
--- a/tests/test_utils/tests.py
+++ b/tests/test_utils/tests.py
@@ -547,6 +547,12 @@ class
AssertTemplateUsedContextManagerTests(SimpleTestCase):
response = self.client.get("/test_utils/no_template_used/")
self.assertTemplateUsed(response, "template_used/base.html")
+ with self.assertRaisesMessage(
+ AssertionError, "No templates used to render the response"
+ ):
+ with self.assertTemplateUsed("template_used/base.html"):
+ self.client.get("/test_utils/no_template_used/")
+
def test_msg_prefix(self):
msg_prefix = "Prefix"
msg = f"{msg_prefix}: No templates used to render the response"
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/34823#comment:3>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.