From f3b4c6f85e4f411a59131316567195f9c4f4037b Mon Sep 17 00:00:00 2001 From: Sunil Mohan Adapa Date: Fri, 15 Mar 2024 12:42:36 -0700 Subject: [PATCH] ttrss: tests: functional: Uninstall during backup/restore test - This checks backup/restore step more accurately with new database user vs. old database user. Signed-off-by: Sunil Mohan Adapa Reviewed-by: James Valleroy --- plinth/modules/ttrss/tests/test_functional.py | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/plinth/modules/ttrss/tests/test_functional.py b/plinth/modules/ttrss/tests/test_functional.py index 8ca0d62ef..77349e3db 100644 --- a/plinth/modules/ttrss/tests/test_functional.py +++ b/plinth/modules/ttrss/tests/test_functional.py @@ -26,7 +26,7 @@ class TestTTRSSApp(functional.BaseAppTests): _subscribe(session_browser) functional.backup_create(session_browser, APP_ID, 'test_ttrss') - _unsubscribe(session_browser) + functional.uninstall(session_browser, self.app_name) functional.backup_restore(session_browser, APP_ID, 'test_ttrss') assert functional.service_is_running(session_browser, APP_ID) @@ -40,7 +40,16 @@ def _ttrss_load_main_interface(browser): functional.eventually(lambda: not overlay.visible) +def _expand_nodes(browser): + """If interface has category nodes collapsed, expand them.""" + nodes = browser.find_by_css('span.dijitTreeExpandoClosed') + for node in nodes: + node.click() + + def _is_feed_shown(browser, invert=False): + """Return whether the test feed is present.""" + _expand_nodes(browser) return browser.is_text_present('Planet Debian') != invert @@ -74,9 +83,7 @@ def _subscribe(browser): def _unsubscribe(browser): """Unsubscribe from a feed in TT-RSS.""" _ttrss_load_main_interface(browser) - expand = browser.find_by_css('span.dijitTreeExpandoClosed') - if expand: - expand.first.click() + _expand_nodes(browser) browser.find_by_text('Planet Debian').click() _click_main_menu_item(browser, 'Unsubscribe')