﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
36589	assertTemplateUsed asserts against template partial name regardless of origin	Jacob Walls	Caitlin B	"Currently, you can provide a named template partial like `""hello""` to `assertTemplateUsed`, which scrupulously complies with its doc'd intention to assert against names, but I can imagine wanting to provide the ""qualified"" path like `my_page.html#hello`:

{{{#!diff
diff --git a/tests/test_utils/templates/template_used/partials.html b/tests/test_utils/templates/template_used/partials.html
new file mode 100644
index 0000000000..5c8db3d657
--- /dev/null
+++ b/tests/test_utils/templates/template_used/partials.html
@@ -0,0 +1,5 @@
+{% partialdef hello %}
+<p>Hello</p>
+{% endpartialdef %}

diff --git a/tests/test_utils/tests.py b/tests/test_utils/tests.py
index 9c22b61b4f..f7500ddc22 100644
--- a/tests/test_utils/tests.py
+++ b/tests/test_utils/tests.py
@@ -510,6 +510,14 @@ class AssertTemplateUsedContextManagerTests(SimpleTestCase):
             render_to_string(""template_used/base.html"")
             render_to_string(""template_used/base.html"")
 
+        # passes
+        with self.assertTemplateUsed(""hello""):
+            render_to_string(""template_used/partials.html#hello"")
+
+        # fails
+        with self.assertTemplateUsed(""template_used/partials.html#hello""):
+            render_to_string(""template_used/partials.html#hello"")
+
     def test_nested_usage(self):
         with self.assertTemplateUsed(""template_used/base.html""):
             with self.assertTemplateUsed(""template_used/include.html""):
}}}

Notice the hint ""Actual template(s) used: hello"" does not point to the origin, really.

{{{#!py
AssertionError: False is not true : Template 'template_used/partials.html#hello' was not a template used to render the response. Actual template(s) used: hello
}}}

And if we regard the ''unqualified'' way as dubious, I'm suggesting we should yank it before 6.0.

The fix doesn't look to be invasive. Curious to hear from others."	Bug	closed	Testing framework	dev	Release blocker	fixed		Farhan Ali Carlton Gibson	Ready for checkin	1	0	0	0	0	0
