| 121 | def test_attrs_with_type(self): |
| 122 | attrs = {'type': 'date'} |
| 123 | widget = MyMultiWidget(widgets=(TextInput, TextInput), attrs=attrs) |
| 124 | self.check_html(widget, 'name', ['john', 'lennon'], html=( |
| 125 | '<input type="date" value="john" name="name_0" />' |
| 126 | '<input type="date" value="lennon" name="name_1" />' |
| 127 | )) |
| 128 | widget = MyMultiWidget(widgets=(TextInput(attrs), TextInput(attrs)), attrs={'attrs': 'number'}) |
| 129 | self.check_html(widget, 'name', ['john', 'lennon'], html=( |
| 130 | '<input type="date" value="john" name="name_0" />' |
| 131 | '<input type="date" value="lennon" name="name_1" />' |
| 132 | )) |
| 133 | widget = MyMultiWidget(widgets=(TextInput(), TextInput()), attrs=attrs) |
| 134 | self.check_html(widget, 'name', ['john', 'lennon'], html=( |
| 135 | '<input type="text" value="john" name="name_0" />' |
| 136 | '<input type="text" value="lennon" name="name_1" />' |
| 137 | )) |
| 138 | |