#25562 closed Bug (fixed)
Time dependent test on Windows: admin_filters.tests.ListFiltersTests.test_datefieldlistfilter_with_time_zone_support
Reported by: | Tim Graham | Owned by: | nobody |
---|---|---|---|
Component: | contrib.admin | Version: | 1.8 |
Severity: | Normal | Keywords: | |
Cc: | Brian Gianforcaro, Aymeric Augustin | Triage Stage: | Ready for checkin |
Has patch: | no | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
This test doesn't pass at all hours of the day on Windows:
Traceback (most recent call last): File "C:\Jenkins\workspace\django-windows\database\sqlite3\label\windows\python\Python27\django\test\utils.py", line 181, in inner return test_func(*args, **kwargs) File "C:\Jenkins\workspace\django-windows\database\sqlite3\label\windows\python\Python27\tests\admin_filters\tests.py", line 387, in test_datefieldlistfilter_with_time_zone_support self.test_datefieldlistfilter() File "C:\Jenkins\workspace\django-windows\database\sqlite3\label\windows\python\Python27\tests\admin_filters\tests.py", line 302, in test_datefieldlistfilter self.assertEqual(choice['selected'], True) AssertionError: False != True
Change History (6)
comment:1 by , 9 years ago
Cc: | added |
---|
comment:2 by , 9 years ago
IIRC time zone supports on Windows requires TIME_ZONE to match the system time zone.
See https://docs.djangoproject.com/en/1.8/ref/settings/#std:setting-TIME_ZONE
As a consequence you can't run a test that requires changing the TIME_ZONE setting (unless you also change the system time zone but that sounds overkill).
comment:3 by , 9 years ago
Triage Stage: | Accepted → Ready for checkin |
---|
Note:
See TracTickets
for help on using tickets.
The issue here seems to related to ticket #2315 and the lack of time.tzset() on Windows. This causes datetime.date.today to return a different value on Windows (ignoring the time zone) than on Unix because the time zone that Django sets is never activated on Windows.
Absent another solution, we can skip the test on Windows, but I'm not sure what this means for timezone support on Windows in general. A note in the timezone docs might be useful.