﻿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
17604	Make use of assertTemplateUsed and assertTemplateNotUsed as ContextManagers	Gregor Müllegger	Gregor Müllegger	"It can be useful to use the assertTemplateUsed assertion on a limited block of code via a context manager instead on a request:

{{{
with self.assertTemplateUsed('template_used/base.html'):
    render_to_string('template_used/base.html')
}}}

This is something that already proofed useful in the soc2011/form-rendering branch. It's implemented there and is well tested: https://github.com/gregmuellegger/django/blob/soc2011/form-rendering/django/test/testcases.py#L720

Same is true for assertTemplateNotUsed.
"	New feature	closed	Testing framework	1.3	Normal	fixed	assertTemplateUsed, assertTemplateNotUsed, contextmanager	kmike84@…	Accepted	1	0	0	0	0	0
