Fix token param in force_authenticate example (#5284)

related_name for Token is `auth_token`, not `token`.
This commit is contained in:
Oliver Eidel 2017-08-14 14:09:47 +02:00 committed by Tom Christie
parent 52e0f3ae08
commit bf4b3ff0d5

View File

@ -82,7 +82,7 @@ For example, when forcibly authenticating using a token, you might do something
user = User.objects.get(username='olivia') user = User.objects.get(username='olivia')
request = factory.get('/accounts/django-superstars/') request = factory.get('/accounts/django-superstars/')
force_authenticate(request, user=user, token=user.token) force_authenticate(request, user=user, token=user.auth_token)
--- ---