diff options
author | Matthew Lemon <lemon@matthewlemon.com> | 2020-06-01 10:54:19 +0100 |
---|---|---|
committer | Matthew Lemon <lemon@matthewlemon.com> | 2020-06-01 10:54:19 +0100 |
commit | fb986e6697f8ffaa34a419bd1b91bdc0fb05a129 (patch) | |
tree | 85e7ea40a90264c42bad2b201ebde54482c79883 /ctrack/conftest.py | |
parent | 70ebd6f51689ab29bdc48fc53edba52d461f39c4 (diff) |
moved some fixtures into conftest
Diffstat (limited to 'ctrack/conftest.py')
-rw-r--r-- | ctrack/conftest.py | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/ctrack/conftest.py b/ctrack/conftest.py index 753335f..bca55ef 100644 --- a/ctrack/conftest.py +++ b/ctrack/conftest.py @@ -26,6 +26,18 @@ from ctrack.users.tests.factories import UserFactory @pytest.fixture +def submode(): + return Submode.objects.create( + descriptor="Light Rail", mode=Mode.objects.create(descriptor="Rail") + ) + + +@pytest.fixture +def mode(): + return Mode.objects.create(descriptor="Rail") + + +@pytest.fixture def role(): return RoleFactory.create(name="Test Role") @@ -95,11 +107,9 @@ def user() -> User: @pytest.fixture -def person(user): +def person(user, submode, org_with_people): + org = org_with_people 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( first_name="Toss", last_name="McBride", |