mirror of
https://github.com/django/django.git
synced 2025-10-30 17:16:10 +00:00
Fixed #17529 -- get_template_from_string default arguments break
``get_template_from_string`` default arguments were breaking ``assertTemplateUsed``. The solution has been to return only the names of the templates with a ``name`` attribute distinct of ``None``. The default ``name`` kwarg of ``Template`` has been changed to ``None``, more pythonic than ``'<Unknown Template>'``.
This commit is contained in:
committed by
Claude Paroz
parent
bc21e9c0d9
commit
72f63bd24d
@@ -121,8 +121,7 @@ class StringOrigin(Origin):
|
||||
|
||||
|
||||
class Template(object):
|
||||
def __init__(self, template_string, origin=None,
|
||||
name='<Unknown Template>'):
|
||||
def __init__(self, template_string, origin=None, name=None):
|
||||
try:
|
||||
template_string = force_text(template_string)
|
||||
except UnicodeDecodeError:
|
||||
|
||||
Reference in New Issue
Block a user