Skip to content

Commit

Permalink
Added test for a user model
Browse files Browse the repository at this point in the history
  • Loading branch information
ArtemVasylchuck committed Aug 5, 2023
1 parent fd39432 commit 968766f
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions app/core/tests/test_models.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
"""
Tests for models.
"""
from django.test import TestCase
from django.contrib.auth import get_user_model


class ModelTests(TestCase):
""" Test models. """

def test_create_user_with_email_successful(self):
""" Test creating a user with an email is successful. """
email = '[email protected]'
password = 'testpass123'
user = get_user_model().objects.create_user(
email=email,
password=password)

self.assertEqual(user.email, email)
self.assertTrue(user.check_password(password))

0 comments on commit 968766f

Please sign in to comment.