Fixed #27759 -- Prevented forms attrs.html template from rendering False attrs.
Regression in b52c73008a
.
This commit is contained in:
parent
88183117c2
commit
5fa390ee81
|
@ -1 +1 @@
|
|||
{% for name, value in widget.attrs.items() %} {{ name }}{% if not value is sameas True %}="{{ value }}"{% endif %}{% endfor %}
|
||||
{% for name, value in widget.attrs.items() %}{% if value is not sameas False %} {{ name }}{% if not value is sameas True %}="{{ value }}"{% endif %}{% endif %}{% endfor %}
|
||||
|
|
|
@ -1 +1 @@
|
|||
{% for name, value in widget.attrs.items %} {{ name }}{% if not value is True %}="{{ value }}"{% endif %}{% endfor %}
|
||||
{% for name, value in widget.attrs.items %}{% if value is not False %} {{ name }}{% if not value is True %}="{{ value }}"{% endif %}{% endif %}{% endfor %}
|
|
@ -13,3 +13,7 @@ class WidgetTests(WidgetTest):
|
|||
|
||||
def test_no_trailing_newline_in_attrs(self):
|
||||
self.check_html(Input(), 'name', 'value', strict=True, html='<input type="None" name="name" value="value" />')
|
||||
|
||||
def test_attr_false_not_rendered(self):
|
||||
html = '<input type="None" name="name" value="value" />'
|
||||
self.check_html(Input(), 'name', 'value', html=html, attrs={'readonly': False})
|
||||
|
|
Loading…
Reference in New Issue