Skip to content

Commit

Permalink
Add knox to installed apps
Browse files Browse the repository at this point in the history
  • Loading branch information
st4lk committed Mar 14, 2019
1 parent 2242d32 commit d91b902
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions tests/test_social.py
Expand Up @@ -73,6 +73,12 @@
}
)

knox_modify_settings = dict(
INSTALLED_APPS={
'append': 'knox',
},
)


class RestSocialMixin(object):
def setUp(self):
Expand Down Expand Up @@ -173,6 +179,7 @@ def test_login_social_oauth1_jwt(self):
})
self.assertEqual(resp.status_code, 200)

@modify_settings(**knox_modify_settings)
def test_login_social_oauth1_knox(self):
"""
Currently oauth1 works only if session is enabled.
Expand Down Expand Up @@ -268,6 +275,7 @@ def _check_login_social_jwt_user(self, url, data, token_type):
self.assertEqual(token_instance['token_type'], token_type)
self.assertEqual(token_instance['email'], self.email)

@modify_settings(**knox_modify_settings)
def _check_login_social_knox_only(self, url, data):
try:
from knox.auth import TokenAuthentication
Expand All @@ -280,6 +288,7 @@ def _check_login_social_knox_only(self, url, data):
user, auth_data = knox_auth.authenticate_credentials(resp.data['token'])
self.assertEqual(user.email, self.email)

@modify_settings(**knox_modify_settings)
def _check_login_social_knox_user(self, url, data):
try:
from knox.auth import TokenAuthentication
Expand Down

0 comments on commit d91b902

Please sign in to comment.