I've recently added authentication (via django.contrib.auth of course) to my application, along with appropriate "signin"/"signup" links to my base.html.
The problem comes when I run manage.py
tests, and I get 4 failures, all from django.contrib.messages.tests:
ERROR: test_middleware_disabled_anon_user (django.contrib.messages.tests.cookie.CookieTest)
ERROR: test_middleware_disabled_anon_user (django.contrib.messages.tests.fallback.FallbackTest)
ERROR: test_middleware_disabled_anon_user (django.contrib.messages.tests.user_messages.LegacyFallbackTest)
ERROR: test_middleware_disabled_anon_user (django.contrib.messages.tests.session.SessionTest)
All with the same failure:
TemplateSyntaxError: Caught NoReverseMatch while rendering: Reverse for 'django.contrib.auth.views.login' with arguments '()' and keyword arguments '{}' not found.
In manage.py shell
this works:
>>> from django.core.urlresolvers import reverse
>>> reverse('django.contrib.auth.views.login')
'/signin/'
However this doesn't:
>>> reverse('django.contrib.auth.views.login', (), {})
Traceback (most recent call last):
File "<console>", line 1, in <module>
File "/Users/dave/Dropbox/Projects/statbooks.co.uk/lib/python2.6/site-packages/django/core/urlresolvers.py", line 350, in reverse
*args, **kwargs)))
File "/Users/dave/Dropbox/Projects/statbooks.co.uk/lib/python2.6/site-packages/django/core/urlresolvers.py", line 296, in reverse
"arguments '%s' not found." % (lookup_view_s, args, kwargs))
NoReverseMatch: Reverse for 'django.contrib.auth.views.login' with arguments '()' and keyword arguments '{}' not found.
Commenting out the {% url %}
tags from my base.html make the tests pass.
What's causing this?