[Django] #25562: Time dependent test on Windows: admin_filters.tests.ListFiltersTests.test_datefieldlistfilter_with_time_zone_support

15 views
Skip to first unread message

Django

unread,
Oct 17, 2015, 8:43:56 AM10/17/15
to django-...@googlegroups.com
#25562: Time dependent test on Windows:
admin_filters.tests.ListFiltersTests.test_datefieldlistfilter_with_time_zone_support
-----------------------------------------+------------------------
Reporter: timgraham | Owner: nobody
Type: Bug | Status: new
Component: contrib.admin | Version: 1.8
Severity: Normal | Keywords:
Triage Stage: Accepted | Has patch: 0
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 0
UI/UX: 0 |
-----------------------------------------+------------------------
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
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/25562>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

Django

unread,
Oct 19, 2015, 12:31:35 PM10/19/15
to django-...@googlegroups.com
#25562: Time dependent test on Windows:
admin_filters.tests.ListFiltersTests.test_datefieldlistfilter_with_time_zone_support
-------------------------------+------------------------------------

Reporter: timgraham | Owner: nobody
Type: Bug | Status: new
Component: contrib.admin | Version: 1.8
Severity: Normal | Resolution:

Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------+------------------------------------
Changes (by timgraham):

* cc: bgianfo, aaugustin (added)


Comment:

The issue here seems to related to ticket #2315 and
[https://github.com/django/django/blob/f59a0401e5d0e19568a038f2a50954d1a9a1526f/django/conf/__init__.py#L119-L129
the lack of time.tzset() on Windows]. This causes
[https://github.com/django/django/blob/f59a0401e5d0e19568a038f2a50954d1a9a1526f/tests/admin_filters/tests.py#L231
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
[https://docs.djangoproject.com/en/stable/topics/i18n/timezones/ the
timezone docs] might be useful.

--
Ticket URL: <https://code.djangoproject.com/ticket/25562#comment:1>

Django

unread,
Oct 19, 2015, 12:51:51 PM10/19/15
to django-...@googlegroups.com
#25562: Time dependent test on Windows:
admin_filters.tests.ListFiltersTests.test_datefieldlistfilter_with_time_zone_support
-------------------------------+------------------------------------

Reporter: timgraham | Owner: nobody
Type: Bug | Status: new
Component: contrib.admin | Version: 1.8
Severity: Normal | Resolution:

Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------+------------------------------------

Comment (by aaugustin):

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).

--
Ticket URL: <https://code.djangoproject.com/ticket/25562#comment:2>

Django

unread,
Oct 19, 2015, 8:10:29 PM10/19/15
to django-...@googlegroups.com
#25562: Time dependent test on Windows:
admin_filters.tests.ListFiltersTests.test_datefieldlistfilter_with_time_zone_support
-------------------------------------+-------------------------------------

Reporter: timgraham | Owner: nobody
Type: Bug | Status: new
Component: contrib.admin | Version: 1.8
Severity: Normal | Resolution:
Keywords: | Triage Stage: Ready for
| checkin

Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by charettes):

* stage: Accepted => Ready for checkin


--
Ticket URL: <https://code.djangoproject.com/ticket/25562#comment:3>

Django

unread,
Oct 19, 2015, 8:27:35 PM10/19/15
to django-...@googlegroups.com
#25562: Time dependent test on Windows:
admin_filters.tests.ListFiltersTests.test_datefieldlistfilter_with_time_zone_support
-------------------------------------+-------------------------------------
Reporter: timgraham | Owner: nobody
Type: Bug | Status: closed
Component: contrib.admin | Version: 1.8
Severity: Normal | Resolution: fixed

Keywords: | Triage Stage: Ready for
| checkin
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Tim Graham <timograham@…>):

* status: new => closed
* resolution: => fixed


Comment:

In [changeset:"4a50daf6b343db1b5c316aa29efd657e160d0cd3" 4a50daf]:
{{{
#!CommitTicketReference repository=""
revision="4a50daf6b343db1b5c316aa29efd657e160d0cd3"
Fixed #25562 -- Skipped a time dependent admin_filters test on Windows.
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/25562#comment:4>

Django

unread,
Oct 19, 2015, 8:28:03 PM10/19/15
to django-...@googlegroups.com
#25562: Time dependent test on Windows:
admin_filters.tests.ListFiltersTests.test_datefieldlistfilter_with_time_zone_support
-------------------------------------+-------------------------------------
Reporter: timgraham | Owner: nobody
Type: Bug | Status: closed
Component: contrib.admin | Version: 1.8

Severity: Normal | Resolution: fixed
Keywords: | Triage Stage: Ready for
| checkin
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by Tim Graham <timograham@…>):

In [changeset:"cf1038d8e39df914bace26d78f321556036a51c6" cf1038d8]:
{{{
#!CommitTicketReference repository=""
revision="cf1038d8e39df914bace26d78f321556036a51c6"
[1.8.x] Fixed #25562 -- Skipped a time dependent admin_filters test on
Windows.

Backport of 4a50daf6b343db1b5c316aa29efd657e160d0cd3 from master
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/25562#comment:5>

Django

unread,
Oct 19, 2015, 8:28:05 PM10/19/15
to django-...@googlegroups.com
#25562: Time dependent test on Windows:
admin_filters.tests.ListFiltersTests.test_datefieldlistfilter_with_time_zone_support
-------------------------------------+-------------------------------------
Reporter: timgraham | Owner: nobody
Type: Bug | Status: closed
Component: contrib.admin | Version: 1.8

Severity: Normal | Resolution: fixed
Keywords: | Triage Stage: Ready for
| checkin
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by Tim Graham <timograham@…>):

In [changeset:"994e7661a8b682ecd2bce4869d5a6cc61ee8c2c9" 994e766]:
{{{
#!CommitTicketReference repository=""
revision="994e7661a8b682ecd2bce4869d5a6cc61ee8c2c9"
[1.9.x] Fixed #25562 -- Skipped a time dependent admin_filters test on
Windows.

Backport of 4a50daf6b343db1b5c316aa29efd657e160d0cd3 from master
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/25562#comment:6>

Reply all
Reply to author
Forward
0 new messages