1
0
mirror of https://github.com/django/django.git synced 2025-10-29 00:26:07 +00:00

[1.11.x] Fixed #28303 -- Prevented localization of attribute values in the DTL attrs.html widget template.

Backport of 3b050fd0d0 from master
This commit is contained in:
Tim Graham
2017-06-17 08:12:05 -04:00
parent 49de4f1541
commit f0ec88fb63
3 changed files with 20 additions and 1 deletions

View File

@@ -0,0 +1,15 @@
from django.forms.widgets import NumberInput
from django.test import override_settings
from .base import WidgetTest
class NumberInputTests(WidgetTest):
@override_settings(USE_L10N=True, USE_THOUSAND_SEPARATOR=True)
def test_attrs_not_localized(self):
widget = NumberInput(attrs={'max': 12345, 'min': 1234, 'step': 9999})
self.check_html(
widget, 'name', 'value',
'<input type="number" name="name" value="value" max="12345" min="1234" step="9999" />'
)