Opened 3 years ago

Closed 3 years ago

#22184 closed Bug (fixed)

template_tests relies on leaking state

Reported by: Aymeric Augustin Owned by: ANUBHAV JOSHI
Component: Template system Version: master
Severity: Normal Keywords:
Cc: anubhav9042@… Triage Stage: Accepted
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

./runtests.py template_tests.tests fails with a very long output, which simply says that the template loaders failed to locate the inclusion.html template.

./runtests.py template_tests.test_loaders template_tests.tests works.

We should figure out what part of template_tests.test_loaders template_tests.tests depends on and make it possible to run template_tests.tests by itself.

I discovered this while working on https://code.djangoproject.com/ticket/22130#comment:10.

Change History (5)

comment:1 Changed 3 years ago by Claude Paroz

Triage Stage: UnreviewedAccepted

comment:2 Changed 3 years ago by ANUBHAV JOSHI

Cc: anubhav9042@… added
Owner: changed from nobody to ANUBHAV JOSHI
Status: newassigned

problem in TEMPLATE_DIRS and LOADERS.
Working on the fix.

Last edited 3 years ago by ANUBHAV JOSHI (previous) (diff)

comment:3 Changed 3 years ago by ANUBHAV JOSHI

I think we need to use https://github.com/django/django/blob/master/tests/template_tests/tests.py#L547
in the loaders. I am having some problem in overriding settings(I have tried using this way).

Thoughts?

comment:4 Changed 3 years ago by ANUBHAV JOSHI

An import was missing which created the function used in creating cache_loader
https://github.com/django/django/pull/2433

comment:5 Changed 3 years ago by Claude Paroz <claude@…>

Resolution: fixed
Status: assignedclosed

In 659b5678fcb89417ce1967bc590fdd693f906e69:

Fixed #22184 -- Allowed template_tests.tests to be run isolated

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