Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Ensured that explicit time zones are rejected by forms.

Refs #19371.
  • Loading branch information...
commit 68b10fa1776f927180dd20f4818b5e6e07537615 1 parent ec2b91f
Aymeric Augustin authored September 21, 2013

Showing 1 changed file with 5 additions and 0 deletions. Show diff stats Hide diff stats

  1. 5  tests/timezones/tests.py
5  tests/timezones/tests.py
@@ -1011,6 +1011,11 @@ def test_form_with_other_timezone(self):
1011 1011
             self.assertTrue(form.is_valid())
1012 1012
             self.assertEqual(form.cleaned_data['dt'], datetime.datetime(2011, 9, 1, 10, 20, 30, tzinfo=UTC))
1013 1013
 
  1014
+    def test_form_with_explicit_timezone(self):
  1015
+        form = EventForm({'dt': '2011-09-01 17:20:30+07:00'})
  1016
+        # Datetime inputs formats don't allow providing a time zone.
  1017
+        self.assertFalse(form.is_valid())
  1018
+
1014 1019
     @skipIf(pytz is None, "this test requires pytz")
1015 1020
     def test_form_with_non_existent_time(self):
1016 1021
         with timezone.override(pytz.timezone('Europe/Paris')):

0 notes on commit 68b10fa

Please sign in to comment.
Something went wrong with that request. Please try again.