Skip to content
This repository has been archived by the owner on Mar 3, 2020. It is now read-only.

Commit

Permalink
Merge pull request #62 from edx/feanil/provider_python3
Browse files Browse the repository at this point in the history
Feanil/provider python3
  • Loading branch information
feanil committed Sep 18, 2019
2 parents 4ddf8e3 + 31b29b4 commit 7c94ce2
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 10 deletions.
9 changes: 5 additions & 4 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@ language: python

python:
- 2.7
- 3.6
- 3.7
- 3.5

dist: xenial

Expand All @@ -19,15 +18,15 @@ matrix:
include:
- python: 2.7
env: TOXENV=quality
- python: 3.5
env: TOXENV=quality
exclude:
- python: 2.7
env: TOXENV=django20
- python: 2.7
env: TOXENV=django21
- python: 2.7
env: TOXENV=django22
allow_failures:
- python: 3.7


cache:
Expand All @@ -51,3 +50,5 @@ deploy:
distributions: sdist bdist_wheel
on:
tags: true
python: 3.5
condition: $TOXENV = quality
2 changes: 1 addition & 1 deletion edx_oauth2_provider/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@
"""
from __future__ import unicode_literals

__version__ = '1.3.0'
__version__ = '1.3.1'
4 changes: 2 additions & 2 deletions edx_oauth2_provider/tests/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ def get_id_token_values(self, scope=None, claims=None):
response = self.get_access_token_response(scope, claims)
self.assertEqual(response.status_code, 200)

values = json.loads(response.content)
values = json.loads(response.content.decode('utf-8'))
self.assertIn('access_token', values)

id_token = values['id_token']
Expand Down Expand Up @@ -160,7 +160,7 @@ def get_with_authorization(self, path, access_token=None, payload=None):
def get_userinfo(self, token=None, scope=None, claims=None):
payload = _add_values({}, 'userinfo', scope, claims)
response = self.get_with_authorization(self.path, token, payload)
values = json.loads(response.content)
values = json.loads(response.content.decode('utf-8'))
return response, values


Expand Down
2 changes: 1 addition & 1 deletion edx_oauth2_provider/tests/test_credentials.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,6 @@ def test_password_grants(self, data):

if data.get('success', False):
self.assertEqual(200, response.status_code)
self.assertIn('access_token', json.loads(response.content))
self.assertIn('access_token', json.loads(response.content.decode('utf-8')))
else:
self.assertEqual(400, response.status_code)
2 changes: 1 addition & 1 deletion edx_oauth2_provider/tests/test_id_token.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ def test_default_scope(self):
response = self.get_access_token_response()
self.assertEqual(200, response.status_code)

values = json.loads(response.content)
values = json.loads(response.content.decode('utf-8'))
scope = values.get('scope', '').split()

# The default scope should be empty
Expand Down
2 changes: 1 addition & 1 deletion edx_oauth2_provider/tests/test_oidc.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ def test_id_token_nonce(self):
self.assertEqual(Grant.objects.filter(client=self.auth_client, user=self.user, nonce=self.nonce).count(), 1)

# Validate ID token nonce
response = json.loads(response.content)
response = json.loads(response.content.decode('utf-8'))
id_token = jwt.decode(response['id_token'], verify=False)
self.assertEqual(id_token['nonce'], self.nonce)

Expand Down

0 comments on commit 7c94ce2

Please sign in to comment.