diff options
author | Matthew Lemon <lemon@matthewlemon.com> | 2020-06-01 10:47:22 +0100 |
---|---|---|
committer | Matthew Lemon <lemon@matthewlemon.com> | 2020-06-01 10:47:22 +0100 |
commit | 70ebd6f51689ab29bdc48fc53edba52d461f39c4 (patch) | |
tree | c542242505a41de0f679f36c678ca3641cc61eb1 | |
parent | 93f5192a2fc8cc5d4977d766367fc2ba69c450b5 (diff) |
consolidate to one conftest
Diffstat (limited to '')
-rw-r--r-- | ctrack/conftest.py | 24 | ||||
-rw-r--r-- | ctrack/organisations/tests/conftest.py | 34 |
2 files changed, 24 insertions, 34 deletions
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 diff --git a/ctrack/organisations/tests/conftest.py b/ctrack/organisations/tests/conftest.py deleted file mode 100644 index 85fa2eb..0000000 --- a/ctrack/organisations/tests/conftest.py +++ /dev/null @@ -1,34 +0,0 @@ -# TODO Here we need to make use of the populate script to create a massive -# test fixture. -import pytest - -from ctrack.core.utils import populate_db -from ctrack.organisations.tests.factories import ( - OrganisationFactory, - PersonFactory, - RoleFactory, -) - - -@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 |