aboutsummaryrefslogtreecommitdiffstats
path: root/ctrack/users/tests/test_models.py
diff options
context:
space:
mode:
authorMatthew Lemon <lemon@matthewlemon.com>2020-10-20 13:45:31 +0100
committerMatthew Lemon <lemon@matthewlemon.com>2020-10-20 13:45:31 +0100
commit4ea13b2ed79e95d2cf710c8d2d6e95fb454e054a (patch)
tree59bebcc5d65e7720d4d171301bb3f9d4a0dcccc7 /ctrack/users/tests/test_models.py
parent5f5a6598c43f7df744c0a9127dced97103136cfe (diff)
added lead and deputy inspector for org methods to User
Diffstat (limited to '')
-rw-r--r--ctrack/users/tests/test_models.py15
1 files changed, 13 insertions, 2 deletions
diff --git a/ctrack/users/tests/test_models.py b/ctrack/users/tests/test_models.py
index 368be34..eff8b42 100644
--- a/ctrack/users/tests/test_models.py
+++ b/ctrack/users/tests/test_models.py
@@ -1,16 +1,27 @@
import pytest
-from ctrack.organisations.models import Stakeholder
+from ctrack.organisations.models import Stakeholder, Submode
pytestmark = pytest.mark.django_db
+def test_user_can_be_lead_inspector(inspector1, org):
+ org.lead_inspector = inspector1
+ org.save()
+ assert inspector1.get_lead_inspector_organisations().first() == org
+
+
+def test_user_can_be_deputy_lead_inspector(inspector1, org):
+ org.deputy_lead_inspector = inspector1
+ org.save()
+ assert inspector1.get_deputy_lead_inspector_organisations().first() == org
+
+
def test_user_get_absolute_url(user):
assert user.get_absolute_url() == f"/users/{user.username}/"
def test_user_is_person_object(user):
-
"""User comes from ctrack.conftest.
"""
assert user