Add model attribute for profile completeness
This commit is contained in:
17
tests/models/test_user.py
Normal file
17
tests/models/test_user.py
Normal file
@@ -0,0 +1,17 @@
|
||||
import pytest
|
||||
|
||||
from atst.models.user import User
|
||||
|
||||
from tests.factories import UserFactory
|
||||
|
||||
|
||||
def test_profile_complete_with_all_info():
|
||||
user = UserFactory.create()
|
||||
assert user.profile_complete
|
||||
|
||||
|
||||
@pytest.mark.parametrize("missing_field", User.REQUIRED_FIELDS)
|
||||
def test_profile_complete_with_missing_info(missing_field):
|
||||
user = UserFactory.create()
|
||||
setattr(user, missing_field, None)
|
||||
assert not user.profile_complete
|
Reference in New Issue
Block a user