﻿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
35571	TypeError in assertTemplateUsed when using pathlib.Path as template_name	Erik Z.	nobody	"Right now it is perfectly fine to use pathlib.Path as an template_name. This works fine for production as the template render fine. However when unit testing the assertTemplateUsed function throws a TypeError:

{{{
File ""<stuff>/.local/lib/python3.12/site-packages/django/test/testcases.py"", line 681, in _assert_template_used
        % (template_name, "", "".join(template_names)),
                          ^^^^^^^^^^^^^^^^^^^^^^^^^
    TypeError: sequence item 0: expected str instance, PosixPath found
}}}

This happens because the template_name is stored as is.

Happened on 5.0.4"	Bug	closed	Testing framework	5.0	Normal	invalid	assertTemplateUsed		Unreviewed	1	0	0	0	1	0
