Skip to content

Commit 3b4f472

Browse files
committed
Test added
1 parent 04a6508 commit 3b4f472

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

oauth2_provider/tests/test_authorization_code.py

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,28 @@ def tearDown(self):
5454
self.dev_user.delete()
5555

5656

57+
class TestRegressionIssue315(BaseTest):
58+
"""
59+
Test to avoid regression for the issue 315: request object
60+
was being reassigned when getting AuthorizationView
61+
"""
62+
63+
def test_request_is_not_overwritten(self):
64+
self.client.login(username="test_user", password="123456")
65+
query_string = urlencode({
66+
'client_id': self.application.client_id,
67+
'response_type': 'code',
68+
'state': 'random_state_string',
69+
'scope': 'read write',
70+
'redirect_uri': 'http://example.it',
71+
})
72+
url = "{url}?{qs}".format(url=reverse('oauth2_provider:authorize'), qs=query_string)
73+
74+
response = self.client.get(url)
75+
self.assertEqual(response.status_code, 200)
76+
assert 'request' not in response.context_data
77+
78+
5779
class TestAuthorizationCodeView(BaseTest):
5880
def test_skip_authorization_completely(self):
5981
"""

0 commit comments

Comments
 (0)