diff --git a/tests/forms_tests/tests/test_forms.py b/tests/forms_tests/tests/test_forms.py
index c05c79a..b1841e0 100644
a
|
b
|
from django.forms.utils import ErrorList
|
19 | 19 | from django.http import QueryDict |
20 | 20 | from django.template import Template, Context |
21 | 21 | from django.test import TestCase |
22 | | from django.test.utils import str_prefix |
| 22 | from django.test.utils import override_settings, str_prefix |
23 | 23 | from django.utils.datastructures import MultiValueDict, MergeDict |
24 | 24 | from django.utils.safestring import mark_safe |
25 | 25 | from django.utils import six |
… |
… |
class FormsTestCase(TestCase):
|
1272 | 1272 | self.assertFalse(p.is_valid()) |
1273 | 1273 | self.assertIn('pedantic', p.changed_data) |
1274 | 1274 | |
| 1275 | @override_settings(USE_L10N=False, DATE_INPUT_FORMATS=('%d.%m.%Y', '%Y-%m-%d')) |
| 1276 | def test_changed_data_date_hidden(self): |
| 1277 | class PersonForm(Form): |
| 1278 | name = CharField() |
| 1279 | birthday = DateField(show_hidden_initial=True) |
| 1280 | |
| 1281 | form = PersonForm(initial={'birthday': datetime.date(1974, 8, 16)}) |
| 1282 | self.assertInHTML( |
| 1283 | '<input id="initial-id_birthday" name="initial-birthday" type="hidden" value="1974-08-16" />', |
| 1284 | form.as_ul()) |
| 1285 | form = PersonForm( |
| 1286 | data={'name': 'John', 'birthday': '16.8.1974', 'initial-birthday': '1974-08-16'}, |
| 1287 | initial={'name': 'John', 'birthday': datetime.date(1974, 8, 16)} |
| 1288 | ) |
| 1289 | self.assertFalse(form.has_changed()) |
| 1290 | |
1275 | 1291 | def test_boundfield_values(self): |
1276 | 1292 | # It's possible to get to the value which would be used for rendering |
1277 | 1293 | # the widget for a field by using the BoundField's value method. |