diff --git a/tests/www/test_views.py b/tests/www/test_views.py index 5ef5a2193f111..41d78c8725f26 100644 --- a/tests/www/test_views.py +++ b/tests/www/test_views.py @@ -2790,9 +2790,9 @@ def test_trigger_dag_form_origin_url(self, test_origin, expected_origin): # https://github.com/python/cpython/pull/24297/files # Check if tests are running with a Python version containing the above fix # where ";" is removed as a separator - if parse_qsl(";a=b") != [(';a', 'b')]: - expected_url = expected_origin.replace("%3B", "&") - expected_url += "=" + if parse_qsl(";a=b") != [(';a', 'b')] and ";" in test_origin: + expected_origin = expected_origin.replace("%3B", "&") + expected_origin += "=" resp = self.client.get(f'trigger?dag_id={test_dag_id}&origin={test_origin}') self.check_content_in_response( @@ -3341,7 +3341,7 @@ def test_get_safe_url(self, test_url, expected_url, mock_url_for): # https://github.com/python/cpython/pull/24297/files # Check if tests are running with a Python version containing the above fix # where ";" is removed as a separator - if parse_qsl(";a=b") != [(';a', 'b')]: + if parse_qsl(";a=b") != [(';a', 'b')] and ";" in test_url: expected_url = expected_url.replace("%3B", "&") expected_url += "="