Skip to content

Commit

Permalink
refactor: merge user_profile and user_management tests in user app
Browse files Browse the repository at this point in the history
  • Loading branch information
rzashakeri committed Jul 16, 2022
1 parent 279c6e0 commit d9d6627
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 58 deletions.
File renamed without changes.
Empty file added user/tests/test_forms.py
Empty file.
28 changes: 28 additions & 0 deletions user/tests/test_models.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
import pytest

from user.models import Profile
from user.models import User


@pytest.mark.django_db
class TestUserProfile:
@pytest.fixture
def user(self):
user, created = User.objects.get_or_create(
first_name="test_first_name",
last_name="test_last_name",
username="test_username",
email="test@test.com",
is_active=True,
is_superuser=False,
)
return user

def test_whether_profile_is_created(self, user):
profile, created = Profile.objects.get_or_create(user)
assert profile.user.first_name == "test_first_name"
assert profile.user.last_name == "test_last_name"
assert profile.user.username == "test_username"
assert profile.user.email == "test@test.com"
assert profile.user.is_active
assert profile.user.is_superuser is False
Empty file added user/tests/test_views.py
Empty file.
58 changes: 0 additions & 58 deletions user_profile/tests/test_models.py

This file was deleted.

0 comments on commit d9d6627

Please sign in to comment.