<filename>src/api/tests/test_user_model.py
from api.models import User
from api.tests.base import BaseTestCase


class TestUserModel(BaseTestCase):
    """ User model test cases """

    def test_create_user_success(self):
        """ Test can add user to db successfully """
        old_count = User.objects.count()
        user = User.objects.create(**{
            'first_name': "Erykah",
            'last_name': "Badu",
            'email':  "<EMAIL>",
            'username':  "badu",
            'password': "<PASSWORD>",
            'user_type':  "professional"
        })
        new_count = User.objects.count()
        self.assertEqual(user.username, 'badu')
        self.assertEqual(new_count, old_count + 1)

<filename>src/api/tests/test_user_model.py
from api.models import User
from api.tests.base import BaseTestCase


class TestUserModel(BaseTestCase):
    """ User model test cases """

    def test_create_user_success(self):
        """ Test can add user to db successfully """
        old_count = User.objects.count()
        user = User.objects.create(**{
            'first_name': "Erykah",
            'last_name': "Badu",
            'email':  "<EMAIL>",
            'username':  "badu",
            'password': "<PASSWORD>",
            'user_type':  "professional"
        })
        new_count = User.objects.count()
        self.assertEqual(user.username, 'badu')
        self.assertEqual(new_count, old_count + 1)

User model test cases Test can add user to db successfully