aboutsummaryrefslogtreecommitdiffstats
path: root/ctrack/users/tests
diff options
context:
space:
mode:
authorMatthew Lemon <lemon@matthewlemon.com>2020-05-22 16:22:30 +0100
committerMatthew Lemon <lemon@matthewlemon.com>2020-05-22 16:22:30 +0100
commit5d489ef3685b32ee5e9c68839b1e187870c0d659 (patch)
treee28d090eb217cad555d07a154e6479878bae5c64 /ctrack/users/tests
parent44959fde6494d90d644a11866d86c704a5cf5034 (diff)
started work on optional User as organisation.Person object - tests
Diffstat (limited to '')
-rw-r--r--ctrack/users/tests/factories.py1
-rw-r--r--ctrack/users/tests/test_models.py13
2 files changed, 14 insertions, 0 deletions
diff --git a/ctrack/users/tests/factories.py b/ctrack/users/tests/factories.py
index b4ddad0..eb5a17f 100644
--- a/ctrack/users/tests/factories.py
+++ b/ctrack/users/tests/factories.py
@@ -8,6 +8,7 @@ class UserFactory(DjangoModelFactory):
username = Faker("user_name")
email = Faker("email")
name = Faker("name")
+ is_person = False
@post_generation
def password(self, create: bool, extracted: Sequence[Any], **kwargs):
diff --git a/ctrack/users/tests/test_models.py b/ctrack/users/tests/test_models.py
index 1b33961..d83d8b8 100644
--- a/ctrack/users/tests/test_models.py
+++ b/ctrack/users/tests/test_models.py
@@ -1,5 +1,12 @@
import pytest
+from django.contrib.auth import get_user_model
+from ctrack.organisations.models import Mode, Person, Submode
+from ctrack.organisations.tests.factories import (
+ OrganisationFactory,
+ PersonFactory,
+ RoleFactory,
+)
from ctrack.users.models import User
pytestmark = pytest.mark.django_db
@@ -7,3 +14,9 @@ pytestmark = pytest.mark.django_db
def test_user_get_absolute_url(user: User):
assert user.get_absolute_url() == f"/users/{user.username}/"
+
+
+def test_user_is_person_object(user: User):
+ """User comes from ctrack.conftest.
+ """
+ assert user.is_person is False