Skip to content

Commit

Permalink
Fix admin fixture in example
Browse files Browse the repository at this point in the history
  • Loading branch information
bmihelac authored and hramezani committed May 27, 2022
1 parent 639012d commit 7f8daa9
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions docs/helpers.rst
Original file line number Diff line number Diff line change
Expand Up @@ -161,13 +161,13 @@ Example

from myapp.views import my_view

def test_details(rf, admin):
def test_details(rf, admin_user):
request = rf.get('/customer/details')
# Remember that when using RequestFactory, the request does not pass
# through middleware. If your view expects fields such as request.user
# to be set, you need to set them explicitly.
# The following line sets request.user to an admin user.
request.user = admin
request.user = admin_user
response = my_view(request)
assert response.status_code == 200

Expand Down

0 comments on commit 7f8daa9

Please sign in to comment.