Skip to content

Commit

Permalink
add user model tests
Browse files Browse the repository at this point in the history
  • Loading branch information
ytliuSVN committed Nov 2, 2024
1 parent e31caf6 commit ff16077
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions app/core/tests/test_models.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
from django.test import TestCase
from django.contrib.auth import get_user_model


class ModelTests(TestCase):

def test_create_user_with_email_successful(self):
email = '[email protected]'
password = 'pp4b'
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 ff16077

Please sign in to comment.