<reponame>mehdiFeghhi/recipe-app-api
from django.test import TestCase
from django.contrib.auth import get_user_model

class ModelTest(TestCase):
    def test_create_user_with_email_successfull(self):
    
        """Test create a new user with an email address"""
        email = '<EMAIL>'
        password = '<PASSWORD>'
        user = get_user_model().objects.create_user(
            email=email, 
            password=password)

        self.assertEqual(user.email, email)
        self.assertTrue(user.check_password(password))
    
    def test_new_user_email_normalized(self):
        
        """Test the email for a new user is normalized"""
        
        email = '<EMAIL>'
        user = get_user_model().objects_create_user(email=email , password="<PASSWORD>")
        
        self.assertEqual(user.email, email.lower())
        
    
from django.test import TestCase
from django.contrib.auth import get_user_model

class ModelTest(TestCase):
    def test_create_user_with_email_successfull(self):
    
        """Test create a new user with an email address"""
        email = '<EMAIL>'
        password = '<PASSWORD>'
        user = get_user_model().objects.create_user(
            email=email, 
            password=password)

        self.assertEqual(user.email, email)
        self.assertTrue(user.check_password(password))
    
    def test_new_user_email_normalized(self):
        
        """Test the email for a new user is normalized"""
        
        email = '<EMAIL>'
        user = get_user_model().objects_create_user(email=email , password="<PASSWORD>")
        
        self.assertEqual(user.email, email.lower())
Test create a new user with an email address Test the email for a new user is normalized