tests: functional: Simplify calling the login helper

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Joseph Nuthalapati <njoseph@riseup.net>
This commit is contained in:
Sunil Mohan Adapa 2020-09-20 20:33:15 -07:00 committed by Joseph Nuthalapati
parent 7b7d42fe33
commit 68475668ea
No known key found for this signature in database
GPG Key ID: 5398F00A2FA43C35
2 changed files with 8 additions and 4 deletions

View File

@ -234,7 +234,13 @@ def _create_admin_account(browser, username, password):
submit(browser)
def login(browser, url, username, password):
def login(browser):
"""Login to the interface."""
login_with_account(browser, base_url, config['DEFAULT']['username'],
config['DEFAULT']['password'])
def login_with_account(browser, url, username, password):
# XXX: Find a way to remove the hardcoded jsxc URL
if '/plinth/' not in browser.url or '/jsxc/jsxc' in browser.url:

View File

@ -13,9 +13,7 @@ from plinth.tests import functional
@given("I'm a logged in user")
def logged_in_user(session_browser):
functional.login(session_browser, functional.base_url,
functional.config['DEFAULT']['username'],
functional.config['DEFAULT']['password'])
functional.login(session_browser)
@given("I'm a logged out user")