Skip to content

Commit

Permalink
Ensured that explicit time zones are rejected by forms.
Browse files Browse the repository at this point in the history
Refs #19371.
  • Loading branch information
aaugustin committed Sep 21, 2013
1 parent ec2b91f commit 68b10fa
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions tests/timezones/tests.py
Expand Up @@ -1011,6 +1011,11 @@ def test_form_with_other_timezone(self):
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')):
Expand Down

0 comments on commit 68b10fa

Please sign in to comment.