2👍
✅
reverse
is for reversing to URL from views or url name AFAIK.
you can do either reverse('django.contrib.auth.views.login')
or name the url and use the name
url(r'^accounts/login/$', 'django.contrib.auth.views.login', {
and
'template_name': 'login.html'
}, name="login"),reverse('login')
The test client in django also has login
method to simulate user login.
See:
https://docs.djangoproject.com/en/1.7/topics/http/urls/#reverse-resolution-of-urls
https://docs.djangoproject.com/en/1.7/topics/testing/tools/#django.test.Client
Source:stackexchange.com