-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: merge user_profile and user_management tests in user app
- Loading branch information
1 parent
279c6e0
commit d9d6627
Showing
5 changed files
with
28 additions
and
58 deletions.
There are no files selected for viewing
File renamed without changes.
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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.
This file was deleted.
Oops, something went wrong.