Skip to content

Commit 6f0a131

Browse files
Fixed tests for Access-Control-Allow-Origin header returned by oauthlib
1 parent 825ce98 commit 6f0a131

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

tests/test_cors.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ def is_origin_allowed(self, client_id, origin, request, *args, **kwargs):
2929

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

7676
auth_headers = get_basic_auth_header(self.application.client_id, CLEARTEXT_SECRET)
77-
auth_headers["origin"] = CLIENT_URI
78-
77+
auth_headers["HTTP_ORIGIN"] = CLIENT_URI
7978
response = self.client.post(reverse("oauth2_provider:token"), data=token_request_data, **auth_headers)
8079
self.assertEqual(response.status_code, 200)
8180
self.assertEqual(response["Access-Control-Allow-Origin"], CLIENT_URI)

0 commit comments

Comments
 (0)