mirror of
https://github.com/Tivix/django-rest-auth.git
synced 2024-12-03 06:13:43 +03:00
updated tests
This commit is contained in:
parent
9bbc4a3014
commit
4fb746e645
|
@ -68,7 +68,7 @@ TEMPLATES = [
|
|||
REST_FRAMEWORK = {
|
||||
'DEFAULT_AUTHENTICATION_CLASSES': (
|
||||
'rest_framework.authentication.SessionAuthentication',
|
||||
'rest_framework_jwt.authentication.JSONWebTokenAuthentication',
|
||||
'rest_framework_simplejwt.authentication.JWTAuthentication',
|
||||
)
|
||||
}
|
||||
|
||||
|
@ -94,8 +94,6 @@ INSTALLED_APPS = [
|
|||
|
||||
'dj_rest_auth',
|
||||
'dj_rest_auth.registration',
|
||||
|
||||
'rest_framework_jwt'
|
||||
]
|
||||
|
||||
SECRET_KEY = "38dh*skf8sjfhs287dh&^hd8&3hdg*j2&sd"
|
||||
|
|
|
@ -152,8 +152,8 @@ class APIBasicTests(TestsMixin, TestCase):
|
|||
get_user_model().objects.create_user(self.USERNAME, '', self.PASS)
|
||||
|
||||
self.post(self.login_url, data=payload, status_code=200)
|
||||
self.assertEqual('token' in self.response.json.keys(), True)
|
||||
self.token = self.response.json['token']
|
||||
self.assertEqual('access_token' in self.response.json.keys(), True)
|
||||
self.token = self.response.json['access_token']
|
||||
|
||||
def test_login_by_email(self):
|
||||
# starting test without allauth app
|
||||
|
@ -382,7 +382,7 @@ class APIBasicTests(TestsMixin, TestCase):
|
|||
"password": self.PASS
|
||||
}
|
||||
self.post(self.login_url, data=payload, status_code=200)
|
||||
self.token = self.response.json['token']
|
||||
self.token = self.response.json['access_token']
|
||||
self.get(self.user_url, status_code=200)
|
||||
|
||||
self.patch(self.user_url, data=self.BASIC_USER_DATA, status_code=200)
|
||||
|
@ -426,7 +426,7 @@ class APIBasicTests(TestsMixin, TestCase):
|
|||
self.post(self.register_url, data={}, status_code=400)
|
||||
|
||||
result = self.post(self.register_url, data=self.REGISTRATION_DATA, status_code=201)
|
||||
self.assertIn('token', result.data)
|
||||
self.assertIn('access_token', result.data)
|
||||
self.assertEqual(get_user_model().objects.all().count(), user_count + 1)
|
||||
|
||||
self._login()
|
||||
|
|
|
@ -305,7 +305,7 @@ class TestSocialAuth(TestsMixin, TestCase):
|
|||
}
|
||||
|
||||
self.post(self.fb_login_url, data=payload, status_code=200)
|
||||
self.assertIn('token', self.response.json.keys())
|
||||
self.assertIn('access_token', self.response.json.keys())
|
||||
self.assertIn('user', self.response.json.keys())
|
||||
|
||||
self.assertEqual(get_user_model().objects.all().count(), users_count + 1)
|
||||
|
|
Loading…
Reference in New Issue
Block a user