backend #1

Merged
s460930 merged 15 commits from backend into develop 2020-12-01 19:31:56 +01:00
2 changed files with 12 additions and 2 deletions
Showing only changes of commit e724d92cc4 - Show all commits

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)