diff options
author | Tyler Jones <tyler@gumstix.com> | 2013-07-26 11:59:50 -0700 |
---|---|---|
committer | Tyler Jones <tyler@gumstix.com> | 2013-07-26 11:59:50 -0700 |
commit | 06a93d1e87ed950138c07ba036554d0d0ddfb87f (patch) | |
tree | 551059e1adf639cfafeab06993d9f880dfe95567 /tests/oauth1/rfc5849/endpoints | |
parent | 513ec6afbb6ab663fd1c9578f4a64fc734d7cb68 (diff) | |
download | oauthlib-06a93d1e87ed950138c07ba036554d0d0ddfb87f.tar.gz |
Added tests.
Diffstat (limited to 'tests/oauth1/rfc5849/endpoints')
-rw-r--r-- | tests/oauth1/rfc5849/endpoints/test_authorization.py | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/tests/oauth1/rfc5849/endpoints/test_authorization.py b/tests/oauth1/rfc5849/endpoints/test_authorization.py index c3876e1..5c603e7 100644 --- a/tests/oauth1/rfc5849/endpoints/test_authorization.py +++ b/tests/oauth1/rfc5849/endpoints/test_authorization.py @@ -15,7 +15,6 @@ class ResourceEndpointTest(TestCase): self.validator.verify_request_token.return_value = True self.validator.verify_realms.return_value = True self.validator.get_realms.return_value = ['test'] - self.validator.get_redirect_uri.return_value = 'https://c.b/cb' self.validator.save_verifier = MagicMock() self.endpoint = AuthorizationEndpoint(self.validator) self.uri = 'https://i.b/authorize?oauth_token=foo' @@ -39,7 +38,15 @@ class ResourceEndpointTest(TestCase): realms=['bar']) def test_create_authorization_response(self): + self.validator.get_redirect_uri.return_value = 'https://c.b/cb' u, h, b, s = self.endpoint.create_authorization_response(self.uri) self.assertEqual(s, 302) self.assertTrue(u.startswith('https://c.b/cb')) self.assertIn('oauth_verifier', u) + + def test_create_authorization_response(self): + self.validator.get_redirect_uri.return_value = 'oob' + u, h, b, s = self.endpoint.create_authorization_response(self.uri) + self.assertEqual(s, 200) + self.assertIn('oauth_verifier', b) + self.assertIn('oauth_token', b) |