From 5f5cec695c353220d7d461384eb6803bd9a39eb0 Mon Sep 17 00:00:00 2001 From: Sunil Mohan Adapa Date: Fri, 21 Aug 2026 21:54:03 -0700 Subject: [PATCH] radicale: tests: Don't fail if Nextcloud is enabled - When Nextcloud is enabled, /.well-known/{card,cal}dav URLs are taken over by Nextcloud. So relying on them makes radicale fail. Instead just check for the web interface to be available. Tests: - Enable Nextcloud and run radicale functional tests. Without the patch tests fail and with the patch, tests succeed. Signed-off-by: Sunil Mohan Adapa Reviewed-by: James Valleroy --- .../modules/radicale/tests/test_functional.py | 26 +++++-------------- 1 file changed, 7 insertions(+), 19 deletions(-) diff --git a/freedombox/modules/radicale/tests/test_functional.py b/freedombox/modules/radicale/tests/test_functional.py index 7a242aa65..c71d61508 100644 --- a/freedombox/modules/radicale/tests/test_functional.py +++ b/freedombox/modules/radicale/tests/test_functional.py @@ -23,15 +23,13 @@ class TestRadicaleApp(functional.BaseAppTests): def assert_app_running(self, session_browser): """Assert that the app is running.""" assert functional.service_is_running(session_browser, self.app_name) - assert _calendar_is_available(session_browser) - assert _addressbook_is_available(session_browser) + assert _web_interface_is_available(session_browser) def assert_app_not_running(self, session_browser): """Assert that the app is not running.""" assert functional.service_is_not_running(session_browser, self.app_name) - assert not _calendar_is_available(session_browser) - assert not _addressbook_is_available(session_browser) + assert not _web_interface_is_available(session_browser) def test_access_rights(self, session_browser): """Test setting the access rights.""" @@ -81,23 +79,13 @@ def _set_access_rights(browser, access_rights_type): functional.submit(browser, form_class='form-configuration') -def _calendar_is_available(browser): - """Return whether calendar is available at well-known URL.""" - return _well_known_available(browser, '/.well-known/caldav') - - -def _addressbook_is_available(browser): - """Return whether addressbook is available at well-known URL.""" - return _well_known_available(browser, '/.well-known/carddav') - - -def _well_known_available(browser, wellknown_url: str): - """Return whether a well-known URL redirects to radicale.""" +def _web_interface_is_available(browser): + """Return whether web interface is available at /radicale/.""" conf = functional.config['DEFAULT'] - url = functional.base_url + wellknown_url + url = functional.base_url + '/radicale/' logging.captureWarnings(True) request = requests.get(url, auth=(conf['username'], conf['password']), verify=False, allow_redirects=False) logging.captureWarnings(False) - return (request.status_code == 301 - and request.headers['Location'].endswith('/radicale/')) + return (request.status_code == 302 + and request.headers['Location'].endswith('/radicale/.web'))