Opened 10 years ago

Closed 10 years ago

Last modified 9 years ago

#21598 closed Cleanup/optimization (fixed)

Cleanup template loader overrides in tests

Reported by: Unai Zalakain Owned by: Unai Zalakain
Component: Template system Version: dev
Severity: Normal Keywords:
Cc: Triage Stage: Accepted
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no


A lot of tests in template_tests repeat a try finally block for overriding the template loader. This could be managed easily with contexts. django.test.utils.setup_test_template_loader makes use of a function base test template loader (which entered a deprecation timeline in 1.4) and together with django.test.utils.restore_template_loaders could also be managed as a context.

Change History (5)

comment:1 by Unai Zalakain, 10 years ago

Owner: changed from nobody to Unai Zalakain
Status: newassigned

comment:2 by Unai Zalakain, 10 years ago

Has patch: set

comment:3 by Ramiro Morales, 10 years ago

Triage Stage: UnreviewedAccepted

comment:4 by Tim Graham <timograham@…>, 10 years ago

Resolution: fixed
Status: assignedclosed

In 4dc4d12e27e4e0337568651136eee5b6f2171204:

Fixed #21598 -- cleaned up template loader overrides in tests

  • Template loader overriding is managed with contexts.
  • The test loader is a class (function based loaders entered deprecation timeline in 1.4).
  • Template loader overrider that overrides with test loader added.

comment:5 by Aymeric Augustin <aymeric.augustin@…>, 9 years ago

In cffa55908271bfbce9069b979ab150cd806c6d59:

Fixed regression in 4dc4d12e. Refs #21598.

That commit contained a mistake that resulted in the use_cached_loader
option of override_with_test_loader being ignored. As a consequence some
configurations weren't exercised any more by the test suite.

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