2017-06-17 12:12:05 +00:00
|
|
|
from django.forms.widgets import NumberInput
|
|
|
|
from django.test import override_settings
|
|
|
|
|
|
|
|
from .base import WidgetTest
|
|
|
|
|
|
|
|
|
|
|
|
class NumberInputTests(WidgetTest):
|
2021-09-09 05:42:05 +00:00
|
|
|
@override_settings(USE_THOUSAND_SEPARATOR=True)
|
2017-06-17 12:12:05 +00:00
|
|
|
def test_attrs_not_localized(self):
|
2022-02-03 19:24:19 +00:00
|
|
|
widget = NumberInput(attrs={"max": 12345, "min": 1234, "step": 9999})
|
2017-06-17 12:12:05 +00:00
|
|
|
self.check_html(
|
2022-02-03 19:24:19 +00:00
|
|
|
widget,
|
|
|
|
"name",
|
|
|
|
"value",
|
2022-02-04 07:08:27 +00:00
|
|
|
'<input type="number" name="name" value="value" max="12345" min="1234" '
|
|
|
|
'step="9999">',
|
2017-06-17 12:12:05 +00:00
|
|
|
)
|