This commit is contained in:
2021-02-14 02:04:50 +00:00
parent a7119599ca
commit b3ceed777e
4 changed files with 46 additions and 17 deletions

View File

@@ -24,17 +24,11 @@ def pytest_configure():
@pytest.fixture
def profile(db):
profile = Profile(
def logged_in_browser(live_server, browser):
profile, created = Profile.objects.get_or_create(
username="EventTest", first_name="Event", last_name="Test", initials="ETU", is_superuser=True)
profile.set_password("EventTestPassword")
profile.save()
yield profile
profile.delete()
@pytest.fixture
def logged_in_browser(live_server, browser, profile):
login_page = pages.LoginPage(browser.driver, live_server.url).open()
login_page.login("EventTest", "EventTestPassword")
return browser