Skip to content

Commit

Permalink
Fixed tests for Access-Control-Allow-Origin header returned by oauthlib
Browse files Browse the repository at this point in the history
  • Loading branch information
akanstantsinau authored and dopry committed Oct 19, 2023
1 parent db6942f commit 16cb613
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions tests/test_cors.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ def is_origin_allowed(self, client_id, origin, request, *args, **kwargs):

@pytest.mark.usefixtures("oauth2_settings")
@pytest.mark.oauth2_settings(presets.DEFAULT_SCOPES_RW)
class CorsTest(TestCase):
class TestCors(TestCase):
"""
Test that CORS headers can be managed by OAuthLib.
The objective is: http request 'Origin' header should be passed to OAuthLib
Expand Down Expand Up @@ -74,8 +74,7 @@ def test_cors_header(self):
}

auth_headers = get_basic_auth_header(self.application.client_id, CLEARTEXT_SECRET)
auth_headers["origin"] = CLIENT_URI

auth_headers["HTTP_ORIGIN"] = CLIENT_URI
response = self.client.post(reverse("oauth2_provider:token"), data=token_request_data, **auth_headers)
self.assertEqual(response.status_code, 200)
self.assertEqual(response["Access-Control-Allow-Origin"], CLIENT_URI)
Expand Down

0 comments on commit 16cb613

Please sign in to comment.