Minor contrib.messages test isolation problem
When running manage.py test
on a project with django.contrib.messages
in INSTALLED_APPS
, if you have a customized 500.html
template which uses the {% url %}
tag to try and resolve any namespaced urls you'll get errors from the test_middleware_disabled_anon_user
test for each of the message backend test classes. Since the base test class overrides the project urls, any custom url namespaces are unresolvable when the test intentionally triggers a server error, causing the test to error out.
Basically the test just needs better isolation from the rest of the project.
Triage Stage: |
Unreviewed → Accepted
|
Has patch: |
set
|
Status: |
new → assigned
|
Triage Stage: |
Accepted → Ready for checkin
|
Resolution: |
→ fixed
|
Status: |
assigned → closed
|
contrib.auth.tests.views.AuthViewsTestCase contains an example of how to do this -- override TEMPLATE_DIRS as part of the test setUp/tearDown.