diff options
author | Matthew Lemon <lemon@matthewlemon.com> | 2020-05-28 16:12:13 +0100 |
---|---|---|
committer | Matthew Lemon <lemon@matthewlemon.com> | 2020-05-28 16:12:13 +0100 |
commit | acf875c2bca1727306cb70aaa37e6f4595209786 (patch) | |
tree | 67390297bcd02b2481f5673629227dfea0884215 /ctrack/conftest.py | |
parent | 4aaa68109434e04d1103710d675efd075b2f744a (diff) | |
parent | 520a9deb13f93c689443c0339b1c96a67f0c15a1 (diff) |
Merge branch 'stakeholder-profile'
Diffstat (limited to 'ctrack/conftest.py')
-rw-r--r-- | ctrack/conftest.py | 25 |
1 files changed, 24 insertions, 1 deletions
diff --git a/ctrack/conftest.py b/ctrack/conftest.py index 60a177f..37a4a6c 100644 --- a/ctrack/conftest.py +++ b/ctrack/conftest.py @@ -1,11 +1,16 @@ +import os + import pytest from django.test import RequestFactory +from selenium import webdriver +from selenium.webdriver.firefox.options import Options from ctrack.organisations.models import ( Address, AddressType, Mode, Organisation, + Stakeholder, Submode, ) from ctrack.organisations.tests.factories import ( @@ -35,8 +40,9 @@ def person(user): submode = Submode.objects.create(descriptor="Light Rail", mode=mode) org = OrganisationFactory.create(submode=submode) person = PersonFactory.create( + first_name="Toss", + last_name="McBride", role=role, - updated_by=user, predecessor=None, organisation__submode=submode, organisation=org, @@ -56,5 +62,22 @@ def addr() -> Address: @pytest.fixture +def stakeholder(person): + s = Stakeholder.objects.create(person=person) + return s + + +@pytest.fixture def request_factory() -> RequestFactory: return RequestFactory() + + +@pytest.fixture(scope="module") +def browser(request): + "Provide selenium webdriver instance." + os.environ["PATH"] += os.pathsep + os.getcwd() + options = Options() + options.headless = True + browser_ = webdriver.Firefox(firefox_options=options) + yield browser_ + browser_.quit() |