Skip to content

Commit

Permalink
Nice
Browse files Browse the repository at this point in the history
  • Loading branch information
matthiask committed Aug 9, 2024
1 parent 5d84cc4 commit a4f7c33
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions accounts/test_login.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,9 @@ def test_server_flow(self):
response, "http://example.com/auth/?prompt=", fetch_redirect_response=False
)

response = client.get("/accounts/google-sso/?code=x", HTTP_ACCEPT_LANGUAGE="en")
response = client.get(
"/accounts/google-sso/?code=x", headers={"accept-language": "en"}
)
self.assertRedirects(response, "/accounts/create/")

response = client.get("/accounts/login/?error=1")
Expand All @@ -94,7 +96,9 @@ def test_server_flow(self):
)

FakeFlow.EMAIL = "[email protected]"
response = client.get("/accounts/google-sso/?code=x", HTTP_ACCEPT_LANGUAGE="en")
response = client.get(
"/accounts/google-sso/?code=x", headers={"accept-language": "en"}
)
self.assertRedirects(response, "/accounts/create/")

response = client.post(
Expand Down Expand Up @@ -122,7 +126,9 @@ def test_server_flow(self):
User.objects.update(is_active=False)
client = Client()
FakeFlow.EMAIL = "[email protected]"
response = client.get("/accounts/google-sso/?code=x", HTTP_ACCEPT_LANGUAGE="en")
response = client.get(
"/accounts/google-sso/?code=x", headers={"accept-language": "en"}
)
self.assertRedirects(response, "/accounts/login/?error=1")
self.assertEqual(
messages(response),
Expand Down

0 comments on commit a4f7c33

Please sign in to comment.