test models, urls, views - 100%
This commit is contained in:
17
tests/unit/profiles/test_models.py
Normal file
17
tests/unit/profiles/test_models.py
Normal file
@@ -0,0 +1,17 @@
|
||||
import pytest
|
||||
from django.contrib.auth.models import User
|
||||
from profiles.models import Profile
|
||||
|
||||
|
||||
@pytest.mark.django_db
|
||||
def test_str_profile():
|
||||
user = User.objects.create(
|
||||
username = 'TestUser',
|
||||
password = 'password',
|
||||
)
|
||||
profile = Profile.objects.create(
|
||||
user=user,
|
||||
favorite_city="Paris",
|
||||
|
||||
)
|
||||
assert str(profile) == "TestUser"
|
||||
Reference in New Issue
Block a user