SMART-30 test for User model
This commit is contained in:
parent
1c6089b674
commit
e724d92cc4
Binary file not shown.
@ -1,7 +1,9 @@
|
||||
from rest_framework.test import APITestCase, APIClient
|
||||
from django.test import TestCase
|
||||
from django.urls import reverse
|
||||
from smartpicasso.app.user.models import User
|
||||
from rest_framework import status
|
||||
from rest_framework.test import APITestCase, APIClient
|
||||
|
||||
from smartpicasso.app.user.models import User
|
||||
|
||||
|
||||
class UserApiTest(APITestCase):
|
||||
@ -19,3 +21,11 @@ class UserApiTest(APITestCase):
|
||||
self.assertEqual(response.status_code, status.HTTP_200_OK)
|
||||
self.assertEqual(response.data['success'], 'True')
|
||||
self.assertIn('token', response.data)
|
||||
|
||||
|
||||
class UserTest(TestCase):
|
||||
|
||||
def test_user_str(self):
|
||||
email = 'test@test.com'
|
||||
user = User.objects.create_user(email=email, password='test')
|
||||
self.assertEqual(str(user), email)
|
||||
|
Loading…
Reference in New Issue
Block a user