aboutsummaryrefslogtreecommitdiffstats
path: root/ctrack/users/tests/test_models.py
diff options
context:
space:
mode:
authorMatthew Lemon <lemon@matthewlemon.com>2020-05-28 16:12:13 +0100
committerMatthew Lemon <lemon@matthewlemon.com>2020-05-28 16:12:13 +0100
commitacf875c2bca1727306cb70aaa37e6f4595209786 (patch)
tree67390297bcd02b2481f5673629227dfea0884215 /ctrack/users/tests/test_models.py
parent4aaa68109434e04d1103710d675efd075b2f744a (diff)
parent520a9deb13f93c689443c0339b1c96a67f0c15a1 (diff)
Merge branch 'stakeholder-profile'
Diffstat (limited to 'ctrack/users/tests/test_models.py')
-rw-r--r--ctrack/users/tests/test_models.py10
1 files changed, 7 insertions, 3 deletions
diff --git a/ctrack/users/tests/test_models.py b/ctrack/users/tests/test_models.py
index 2d45cca..368be34 100644
--- a/ctrack/users/tests/test_models.py
+++ b/ctrack/users/tests/test_models.py
@@ -1,6 +1,6 @@
import pytest
-from ctrack.users.stakeholder import Stakeholder
+from ctrack.organisations.models import Stakeholder
pytestmark = pytest.mark.django_db
@@ -16,10 +16,14 @@ def test_user_is_person_object(user):
assert user
-def test_stakeholder_model(person):
+def test_stakeholder_model(person, user):
"""
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
+ org = person.organisation.name
+ user.stakeholder = stakeholder
+ assert user.stakeholder.person.first_name == "Toss"
+ assert user.is_stakeholder is True
+ assert user.get_organisation_name() == org