mirror of
https://github.com/encode/django-rest-framework.git
synced 2024-11-29 13:04:03 +03:00
Fix token param in force_authenticate example (#5284)
related_name for Token is `auth_token`, not `token`.
This commit is contained in:
parent
52e0f3ae08
commit
bf4b3ff0d5
|
@ -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)
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user