diff options
| author | Aymeric Augustin <aymeric.augustin@m4x.org> | 2013-09-21 21:08:52 +0200 |
|---|---|---|
| committer | Aymeric Augustin <aymeric.augustin@m4x.org> | 2013-09-21 21:09:25 +0200 |
| commit | 68b10fa1776f927180dd20f4818b5e6e07537615 (patch) | |
| tree | 4cdd64e8f1ee7cad3aa810b9e1a9c0ddcbd30d7e | |
| parent | ec2b91f48b0cea45afd4470a6c1cbb4ea939514f (diff) | |
Ensured that explicit time zones are rejected by forms.
Refs #19371.
| -rw-r--r-- | tests/timezones/tests.py | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/tests/timezones/tests.py b/tests/timezones/tests.py index e9d29f704b..66d25f5e8a 100644 --- a/tests/timezones/tests.py +++ b/tests/timezones/tests.py @@ -1011,6 +1011,11 @@ class NewFormsTests(TestCase): self.assertTrue(form.is_valid()) self.assertEqual(form.cleaned_data['dt'], datetime.datetime(2011, 9, 1, 10, 20, 30, tzinfo=UTC)) + def test_form_with_explicit_timezone(self): + form = EventForm({'dt': '2011-09-01 17:20:30+07:00'}) + # Datetime inputs formats don't allow providing a time zone. + self.assertFalse(form.is_valid()) + @skipIf(pytz is None, "this test requires pytz") def test_form_with_non_existent_time(self): with timezone.override(pytz.timezone('Europe/Paris')): |
