mirror of
https://github.com/freedombox/FreedomBox.git
synced 2026-08-26 12:46:08 +00:00
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:
parent
7b7d42fe33
commit
68475668ea
@ -234,7 +234,13 @@ def _create_admin_account(browser, username, password):
|
|||||||
submit(browser)
|
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
|
# XXX: Find a way to remove the hardcoded jsxc URL
|
||||||
if '/plinth/' not in browser.url or '/jsxc/jsxc' in browser.url:
|
if '/plinth/' not in browser.url or '/jsxc/jsxc' in browser.url:
|
||||||
|
|||||||
@ -13,9 +13,7 @@ from plinth.tests import functional
|
|||||||
|
|
||||||
@given("I'm a logged in user")
|
@given("I'm a logged in user")
|
||||||
def logged_in_user(session_browser):
|
def logged_in_user(session_browser):
|
||||||
functional.login(session_browser, functional.base_url,
|
functional.login(session_browser)
|
||||||
functional.config['DEFAULT']['username'],
|
|
||||||
functional.config['DEFAULT']['password'])
|
|
||||||
|
|
||||||
|
|
||||||
@given("I'm a logged out user")
|
@given("I'm a logged out user")
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user