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 authored and Joseph Nuthalapati committed 2020-09-27 22:15:27 +05:30
1 parent 7b7d42fe33
commit 68475668ea
2 files changed
+8 -4

No files matched your search

+7 -1
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:
+1 -3
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")