From 95abc04075fc8ba8df17f5e44c7125efad1e1718 Mon Sep 17 00:00:00 2001 From: Reto Tschuppert Date: Fri, 17 Jan 2025 08:47:01 +0100 Subject: [PATCH] Town6 is now in h5 tag, simplify strip --- tests/onegov/org/test_views_search.py | 6 +++--- tests/onegov/town6/test_views_search.py | 10 +++++----- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/tests/onegov/org/test_views_search.py b/tests/onegov/org/test_views_search.py index 354597520a..af73224a3b 100644 --- a/tests/onegov/org/test_views_search.py +++ b/tests/onegov/org/test_views_search.py @@ -427,7 +427,7 @@ def test_search_future_events_are_sorted_by_occurrence_date(client_with_es): for current_client in (client, member, anom): results = current_client.get('/search?q=Concert') # Expect ordered by occurrence date, for all search results of 'Event' - assert [a.text.rstrip(' \n') for a in + assert [a.text.strip() for a in results.pyquery('li.search-result-events a')] == [ 'Not sorted Concert', 'First Concert', 'Second Concert', 'Third Concert', 'Forth Concert' @@ -436,9 +436,9 @@ def test_search_future_events_are_sorted_by_occurrence_date(client_with_es): # postgres for current_client in (client, member, anom): results = current_client.get('/search-postgres?q=Concert') - # Expect future events ordered by occurrence date, fare future first. + # Expect future events ordered by occurrence date, far future first. # Past events are not sorted by occurrence date. - assert [a.text.rstrip(' \n') for a in + assert [a.text.strip() for a in results.pyquery('li.search-result-events a')] == [ 'Forth Concert', 'Third Concert', 'Second Concert', 'First Concert', 'Not sorted Concert' diff --git a/tests/onegov/town6/test_views_search.py b/tests/onegov/town6/test_views_search.py index 91c6f947ad..3e27457998 100644 --- a/tests/onegov/town6/test_views_search.py +++ b/tests/onegov/town6/test_views_search.py @@ -428,8 +428,8 @@ def test_search_future_events_are_sorted_by_occurrence_date(client_with_es): for current_client in (client, member, anom): results = current_client.get('/search?q=Concert') # Expect ordered by occurrence date, for all search results of 'Event' - assert [a.text.rstrip(' \n') for a in - results.pyquery('li.search-result-events a')] == [ + assert [t.text.strip() for t in + results.pyquery('li.search-result-events a h5')] == [ 'Not sorted Concert', 'First Concert', 'Second Concert', 'Third Concert', 'Forth Concert' ] @@ -437,10 +437,10 @@ def test_search_future_events_are_sorted_by_occurrence_date(client_with_es): # postgres for current_client in (client, member, anom): results = current_client.get('/search-postgres?q=Concert') - # Expect future events ordered by occurrence date, fare future first. + # Expect future events ordered by occurrence date, far future first. # Past events are not sorted by occurrence date. - assert [a.text.rstrip(' \n') for a in - results.pyquery('li.search-result-events a')] == [ + assert [t.text.strip() for t in + results.pyquery('li.search-result-events a h5')] == [ 'Forth Concert', 'Third Concert', 'Second Concert', 'First Concert', 'Not sorted Concert' ]