Opened 3 years ago

Closed 3 years ago

#21992 closed Bug (fixed)

test_naturalday_uses_localtime fails on Windows

Reported by: anonymous Owned by: nobody
Component: contrib.humanize Version: master
Severity: Normal Keywords:
Cc: Triage Stage: Accepted
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: yes
Easy pickings: no UI/UX: no


django.contrib.humanize.tests.test_naturalday_uses_localtime is decorated by a skipIf clause as per #19203.
However, running on a Windows machine -- with pytz not installed and system timezone set to UTC -- the skip condition still evaluates to False. This is since settings.TIME_ZONE does default to "America/Chicago", and, as a result, the test case fails.

Change History (4)

comment:1 Changed 3 years ago by Marc Tamlyn

Needs documentation: unset
Needs tests: unset
Patch needs improvement: unset
Triage Stage: UnreviewedAccepted

comment:2 Changed 3 years ago by anonymous

comment:3 Changed 3 years ago by Aymeric Augustin

Patch needs improvement: set

I think @require_tz_support is the answer here. The test attempt to change the time zone and Windows cannot do that.

comment:4 Changed 3 years ago by Aymeric Augustin

Resolution: fixed
Status: newclosed

It looks like this was fixed in 651a6f76f30f4083dfa2a75c5acd86359c2fc4a2.

Note: See TracTickets for help on using tickets.
Back to Top