From 4aaa68109434e04d1103710d675efd075b2f744a Mon Sep 17 00:00:00 2001 From: Matthew Lemon Date: Sun, 24 May 2020 21:11:40 +0100 Subject: added basic stakeholder profile model --- ctrack/users/tests/test_models.py | 15 ++++++++++++--- ctrack/users/tests/test_views.py | 3 +-- 2 files changed, 13 insertions(+), 5 deletions(-) (limited to 'ctrack/users/tests') 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" -- cgit v1.2.3