Opened 12 years ago
Closed 12 years ago
#21992 closed Bug (fixed)
test_naturalday_uses_localtime fails on Windows
| Reported by: | anonymous | Owned by: | nobody |
|---|---|---|---|
| Component: | contrib.humanize | Version: | dev |
| 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 |
Description
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 by , 12 years ago
| Triage Stage: | Unreviewed → Accepted |
|---|
comment:2 by , 12 years ago
comment:3 by , 12 years ago
| 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 by , 12 years ago
| Resolution: | → fixed |
|---|---|
| Status: | new → closed |
It looks like this was fixed in 651a6f76f30f4083dfa2a75c5acd86359c2fc4a2.
Relevant pull request: https://github.com/django/django/pull/2250