aboutsummaryrefslogtreecommitdiffstats
path: root/ctrack/users/tests
diff options
context:
space:
mode:
authorMatthew Lemon <lemon@matthewlemon.com>2020-05-24 21:11:40 +0100
committerMatthew Lemon <lemon@matthewlemon.com>2020-05-24 21:11:40 +0100
commit4aaa68109434e04d1103710d675efd075b2f744a (patch)
tree230e0c464939e828df2ab51fca65d228e44f01cd /ctrack/users/tests
parent708b983c9cb0895ae0d205013d46a17020c4ef73 (diff)
added basic stakeholder profile model
Diffstat (limited to 'ctrack/users/tests')
-rw-r--r--ctrack/users/tests/test_models.py15
-rw-r--r--ctrack/users/tests/test_views.py3
2 files changed, 13 insertions, 5 deletions
diff --git a/ctrack/users/tests/test_models.py b/ctrack/users/tests/test_models.py
index c429b9c..2d45cca 100644
--- a/ctrack/users/tests/test_models.py
+++ b/ctrack/users/tests/test_models.py
@@ -1,16 +1,25 @@
import pytest
-from ctrack.users.models import User
+from ctrack.users.stakeholder import Stakeholder
pytestmark = pytest.mark.django_db
-def test_user_get_absolute_url(user: User):
+def test_user_get_absolute_url(user):
assert user.get_absolute_url() == f"/users/{user.username}/"
-def test_user_is_person_object(user: User):
+def test_user_is_person_object(user):
"""User comes from ctrack.conftest.
"""
assert user
+
+
+def test_stakeholder_model(person):
+ """
+ A stakeholder is someone who is part of the regime but also has user access to the
+ the system.
+ """
+ stakeholder = Stakeholder(person=person)
+ assert stakeholder
diff --git a/ctrack/users/tests/test_views.py b/ctrack/users/tests/test_views.py
index 561c540..3299cd6 100644
--- a/ctrack/users/tests/test_views.py
+++ b/ctrack/users/tests/test_views.py
@@ -2,7 +2,6 @@ import pytest
from django.contrib.auth import get_user_model
from django.test import RequestFactory
-from ctrack.organisations.tests.factories import OrganisationFactory
from ctrack.users.models import User
from ctrack.users.views import UserDetailView, UserRedirectView, UserUpdateView
@@ -64,4 +63,4 @@ def test_profile_view_contains_organisation_information():
response = UserDetailView.as_view()(request, username=user.username)
assert response.status_code == 200
# TODO - work out how we can attach an organisation to the User model
- assert response.context_data["object"]
+ assert False, "This does nothing yet"