mirror of
https://github.com/encode/django-rest-framework.git
synced 2025-02-03 05:04:31 +03:00
add missing import in tests
This commit is contained in:
parent
3a71b6c9f5
commit
d9c652813d
|
@ -65,6 +65,8 @@ When testing views directly using a request factory, it's often convenient to be
|
|||
|
||||
To forcibly authenticate a request, use the `force_authenticate()` method.
|
||||
|
||||
from rest_framework.tests import force_authenticate
|
||||
|
||||
factory = APIRequestFactory()
|
||||
user = User.objects.get(username='olivia')
|
||||
view = AccountDetail.as_view()
|
||||
|
|
Loading…
Reference in New Issue
Block a user