Opened 3 years ago

Closed 3 years ago

#18321 closed Bug (wontfix)

generic_views unit tests are not respecting database feature supports_timezones

Reported by: manfre Owned by: nobody
Component: Testing framework Version: master
Severity: Normal Keywords:
Cc: Triage Stage: Unreviewed
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no


Tests that specifically target timezone support, should be skipped if the database backend states it does not support timezones.

Attachments (1)

django-ticket18321.diff (3.6 KB) - added by manfre 3 years ago.

Download all attachments as: .zip

Change History (2)

Changed 3 years ago by manfre

comment:1 Changed 3 years ago by aaugustin

  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset
  • Resolution set to wontfix
  • Status changed from new to closed

MySQL, SQLite and Oracle have support_timezones = False because either they're unable to store aware datetimes or their Python adapters are unable to handle them.

But it's important to test that they behave correctly when USE_TZ = True. Your patch would disable several tests for these three backends, which isn't acceptable. I suspect you misunderstood the meaning of the supports_timezones feature flag.

(Also, there are other tests that require timezone support, starting with tests.modeltests.timezones, I'm not sure why the patch only applies to tests.regressiontests.generic_views.)

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