-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest_authentication.py
More file actions
30 lines (26 loc) · 839 Bytes
/
test_authentication.py
File metadata and controls
30 lines (26 loc) · 839 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
import rest_framework.status
import rest_framework.test
import user.models
import user.tests.auth.base
class UserAuthenticationTests(user.tests.auth.base.BaseUserAuthTestCase):
def test_signin_success(self):
user.models.User.objects.create_user(
email='minecraft.digger@gmail.com',
name='Steve',
surname='Jobs',
password='SuperStrongPassword2000!',
other={'age': 23, 'country': 'gb'},
)
data = {
'email': 'minecraft.digger@gmail.com',
'password': 'SuperStrongPassword2000!',
}
response = self.client.post(
self.signin_url,
data,
format='json',
)
self.assertEqual(
response.status_code,
rest_framework.status.HTTP_200_OK,
)