Skip to content

Commit

Permalink
Quickfix
Browse files Browse the repository at this point in the history
  • Loading branch information
c4ffein committed Oct 6, 2024
1 parent ce9a60e commit 22e04cd
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions tests/test_csrf.py
Original file line number Diff line number Diff line change
Expand Up @@ -129,21 +129,21 @@ def obtain_csrf_token_post_no_auth_route(request):
# can get csrf cookie through get
response = client.get("/obtain_csrf_token_get")
assert response.status_code == 200
assert len(response.cookies["csrftoken"].value) == 32
assert len(response.cookies["csrftoken"].value) > 0
# can get csrf cookie through exempted post
response = client.post("/obtain_csrf_token_post")
assert response.status_code == 200
assert len(response.cookies["csrftoken"].value) == 32
assert len(response.cookies["csrftoken"].value) > 0
# Now testing a route with disabled auth from a client with django_auth set globally also works
client = TestClient(csrf_ON_with_django_auth)
# can get csrf cookie through get on route with disabled auth
response = client.get("/obtain_csrf_token_get")
assert response.status_code == 200
assert len(response.cookies["csrftoken"].value) == 32
assert len(response.cookies["csrftoken"].value) > 0
# can get csrf cookie through exempted post on route with disabled auth
response = client.post("/obtain_csrf_token_post")
assert response.status_code == 200
assert len(response.cookies["csrftoken"].value) == 32
assert len(response.cookies["csrftoken"].value) > 0


def test_docs():
Expand Down

0 comments on commit 22e04cd

Please sign in to comment.