Skip to content

Commit

Permalink
Merge 2702313 into 6896506
Browse files Browse the repository at this point in the history
  • Loading branch information
Bakley committed May 7, 2019
2 parents 6896506 + 2702313 commit 087c2dc
Showing 1 changed file with 6 additions and 11 deletions.
17 changes: 6 additions & 11 deletions authors/apps/authentication/tests/test_jwt_authentication.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,17 +64,6 @@ def test_inactive_user(self):
'Your account is not active!')
self.assertEqual(response.status_code, status.HTTP_403_FORBIDDEN)

def test_unverified_user(self):
self.signup_user('Mariga', 'mariga@betin.com', 'Maina9176')
token = self.generate_jwt_token('mariga@betin.com', 'Mariga')
self.client.credentials(
HTTP_AUTHORIZATION='Bearer ' + token)
response = self.client.get(self.get_url)
self.assertEqual(
response.data['detail'],
'This user has not been verified')
self.assertEqual(response.status_code, status.HTTP_403_FORBIDDEN)

def test_user_not_found_from_token(self):
token = self.generate_jwt_token('ianmwangi@gmail.com', 'ianmaina')
self.client.credentials(
Expand All @@ -94,3 +83,9 @@ def test_expired_jwt_token(self):
response.data['detail'],
'The token used has expired. Please authenticate again!')
self.assertEqual(response.status_code, status.HTTP_403_FORBIDDEN)

def test_unverified_user(self):
self.signup_user('Mariga', 'mariga@betin.com', 'HDello14#')
response = self.client.patch(self.update_url)

self.assertEqual(response.status_code, status.HTTP_403_FORBIDDEN)

0 comments on commit 087c2dc

Please sign in to comment.