From 0603f09318049e67320121ace035b7ab03f88ca3 Mon Sep 17 00:00:00 2001 From: Gavin Wahl Date: Tue, 15 Sep 2015 11:46:03 -0600 Subject: [PATCH] Refs #25149 -- Fixed regression in admin datetime widget for timezones on the negative side of UTC. --- django/contrib/admin/templates/admin/base.html | 2 +- tests/admin_widgets/tests.py | 15 +++++++++++++++ 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/django/contrib/admin/templates/admin/base.html b/django/contrib/admin/templates/admin/base.html index fa6ee41b085..ad8663f00dc 100644 --- a/django/contrib/admin/templates/admin/base.html +++ b/django/contrib/admin/templates/admin/base.html @@ -12,7 +12,7 @@ {% load i18n %} + data-admin-utc-offset="{% now "Z" %}">
diff --git a/tests/admin_widgets/tests.py b/tests/admin_widgets/tests.py index 8572db508a1..571816a6327 100644 --- a/tests/admin_widgets/tests.py +++ b/tests/admin_widgets/tests.py @@ -884,6 +884,21 @@ class DateTimePickerShortcutsSeleniumIETests(DateTimePickerShortcutsSeleniumFire webdriver_class = 'selenium.webdriver.ie.webdriver.WebDriver' +# The above tests run with Asia/Singapore which are on the positive side of +# UTC. Here we test with a timezone on the negative side. +@override_settings(TIME_ZONE='US/Eastern') +class DateTimePickerAltTimezoneSeleniumFirefoxTests(DateTimePickerShortcutsSeleniumFirefoxTests): + pass + + +class DateTimePickerAltTimezoneSeleniumChromeTests(DateTimePickerAltTimezoneSeleniumFirefoxTests): + webdriver_class = 'selenium.webdriver.chrome.webdriver.WebDriver' + + +class DateTimePickerAltTimezoneSeleniumIETests(DateTimePickerAltTimezoneSeleniumFirefoxTests): + webdriver_class = 'selenium.webdriver.ie.webdriver.WebDriver' + + @override_settings(PASSWORD_HASHERS=['django.contrib.auth.hashers.SHA1PasswordHasher'], ROOT_URLCONF='admin_widgets.urls') class HorizontalVerticalFilterSeleniumFirefoxTests(SeleniumDataMixin, AdminSeleniumWebDriverTestCase):