SMART-30 test for User model

This commit is contained in:
s460930 2020-12-01 19:25:25 +01:00
parent 1c6089b674
commit e724d92cc4
2 changed files with 12 additions and 2 deletions

View File

@ -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)