1
0
mirror of https://github.com/django/django.git synced 2025-01-23 08:39:17 +00:00
Mariusz Felisiak 6872ce2266 Fixed #27712 -- Reallowed Input widget's attrs argument to set the input type.
Regression in b52c73008a9d67e9ddbb841872dc15cdd3d6ee01.
2017-01-10 11:38:27 -05:00

16 lines
626 B
Python

from django.forms.widgets import Input
from .base import WidgetTest
class InputTests(WidgetTest):
def test_attrs_with_type(self):
attrs = {'type': 'date'}
widget = Input(attrs)
self.check_html(widget, 'name', 'value', '<input type="date" name="name" value="value" />')
# reuse the same attrs for another widget
self.check_html(Input(attrs), 'name', 'value', '<input type="date" name="name" value="value" />')
attrs['type'] = 'number' # shouldn't change the widget type
self.check_html(widget, 'name', 'value', '<input type="date" name="name" value="value" />')