From 70ebd6f51689ab29bdc48fc53edba52d461f39c4 Mon Sep 17 00:00:00 2001 From: Matthew Lemon Date: Mon, 1 Jun 2020 10:47:22 +0100 Subject: consolidate to one conftest --- ctrack/conftest.py | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) (limited to 'ctrack/conftest.py') diff --git a/ctrack/conftest.py b/ctrack/conftest.py index c115b4e..753335f 100644 --- a/ctrack/conftest.py +++ b/ctrack/conftest.py @@ -25,6 +25,30 @@ from ctrack.users.models import User from ctrack.users.tests.factories import UserFactory +@pytest.fixture +def role(): + return RoleFactory.create(name="Test Role") + + +@pytest.fixture +def org_with_people(role): + org = OrganisationFactory.create( + submode=None, + name="TEST ORGANISATION", + designation_type=3, + registered_company_name="Test PLC", + comments="NA", + ) + PersonFactory.create( + role=role, + job_title="Test Job Title", + predecessor=None, + organisation__submode=None, + organisation=org, + ) + return org + + @pytest.fixture(autouse=True) def media_storage(settings, tmpdir): settings.MEDIA_ROOT = tmpdir.strpath -- cgit v1.2.3