aboutsummaryrefslogtreecommitdiffstats
path: root/ctrack/conftest.py
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/conftest.py
parent708b983c9cb0895ae0d205013d46a17020c4ef73 (diff)
added basic stakeholder profile model
Diffstat (limited to 'ctrack/conftest.py')
-rw-r--r--ctrack/conftest.py36
1 files changed, 30 insertions, 6 deletions
diff --git a/ctrack/conftest.py b/ctrack/conftest.py
index 8c40fe4..60a177f 100644
--- a/ctrack/conftest.py
+++ b/ctrack/conftest.py
@@ -1,13 +1,21 @@
import pytest
from django.test import RequestFactory
-from ctrack.organisations.models import AddressType
-from ctrack.users.models import User
-from ctrack.organisations.models import Organisation, Address
-from ctrack.users.tests.factories import (
- UserFactory,
+from ctrack.organisations.models import (
+ Address,
+ AddressType,
+ Mode,
+ Organisation,
+ Submode,
+)
+from ctrack.organisations.tests.factories import (
+ AddressFactory,
+ OrganisationFactory,
+ PersonFactory,
+ RoleFactory,
)
-from ctrack.organisations.tests.factories import OrganisationFactory, AddressFactory
+from ctrack.users.models import User
+from ctrack.users.tests.factories import UserFactory
@pytest.fixture(autouse=True)
@@ -21,6 +29,22 @@ def user() -> User:
@pytest.fixture
+def person(user):
+ role = RoleFactory.create(name="Compliance Inspector")
+ mode = Mode.objects.create(descriptor="Rail")
+ submode = Submode.objects.create(descriptor="Light Rail", mode=mode)
+ org = OrganisationFactory.create(submode=submode)
+ person = PersonFactory.create(
+ role=role,
+ updated_by=user,
+ predecessor=None,
+ organisation__submode=submode,
+ organisation=org,
+ )
+ return person
+
+
+@pytest.fixture
def org() -> Organisation:
return OrganisationFactory()