Fix in authorize endpoint tests.
This commit is contained in:
parent
5ee9633658
commit
dda38fd451
|
@ -13,6 +13,10 @@ from oidc_provider.views import *
|
||||||
|
|
||||||
|
|
||||||
class AuthorizationCodeFlowTestCase(TestCase):
|
class AuthorizationCodeFlowTestCase(TestCase):
|
||||||
|
"""
|
||||||
|
An Authentication Request is an OAuth 2.0 Authorization Request that
|
||||||
|
requests that the End-User be authenticated by the Authorization Server.
|
||||||
|
"""
|
||||||
|
|
||||||
def setUp(self):
|
def setUp(self):
|
||||||
self.factory = RequestFactory()
|
self.factory = RequestFactory()
|
||||||
|
@ -194,10 +198,8 @@ class AuthorizationCodeFlowTestCase(TestCase):
|
||||||
code = (response['Location'].split('code='))[1].split('&')[0]
|
code = (response['Location'].split('code='))[1].split('&')[0]
|
||||||
try:
|
try:
|
||||||
code = Code.objects.get(code=code)
|
code = Code.objects.get(code=code)
|
||||||
if (code.client == self.client) or (code.user == self.user):
|
is_code_ok = (code.client == self.client) and \
|
||||||
is_code_ok = True
|
(code.user == self.user)
|
||||||
else:
|
|
||||||
is_code_ok = False
|
|
||||||
except:
|
except:
|
||||||
is_code_ok = False
|
is_code_ok = False
|
||||||
self.assertEqual(is_code_ok, True,
|
self.assertEqual(is_code_ok, True,
|
||||||
|
@ -207,3 +209,10 @@ class AuthorizationCodeFlowTestCase(TestCase):
|
||||||
state = (response['Location'].split('state='))[1].split('&')[0]
|
state = (response['Location'].split('state='))[1].split('&')[0]
|
||||||
self.assertEqual(state == self.state, True,
|
self.assertEqual(state == self.state, True,
|
||||||
msg='State change or is missing.')
|
msg='State change or is missing.')
|
||||||
|
|
||||||
|
|
||||||
|
class AuthorizationImplicitFlowTestCase(TestCase):
|
||||||
|
"""
|
||||||
|
TODO.
|
||||||
|
"""
|
||||||
|
pass
|
Loading…
Reference in a new issue