on master help sign in
[fix] infoboxes and answers : pass all tests
728fc61dalf
searx/templates/default/result_templates/default.html+1−3
@@ -8,8 +8,6 @@
8 <h3 class="result_title"><a href="{{ result.url }}">{{ result.title|safe }}</a></h3>
8 <h3 class="result_title"><a href="{{ result.url }}">{{ result.title|safe }}</a></h3>
9 <p class="url">{{ result.pretty_url }} <a class="cache_link" href="https://web.archive.org/web/{{ result.url }}">cached</a></p>
9 <p class="url">{{ result.pretty_url }} <a class="cache_link" href="https://web.archive.org/web/{{ result.url }}">cached</a></p>
10 {% if result.publishedDate %}<p class="published_date">{{ result.publishedDate }}</p>{% endif %}
10 {% if result.publishedDate %}<p class="published_date">{{ result.publishedDate }}</p>{% endif %}
11− <p class="content">
12− {% if result.img_src %}<img src="{{ result.img_src|safe }}" class="image" />{% endif %}
11+ <p class="content">{% if result.img_src %}<img src="{{ result.img_src|safe }}" class="image" />{% endif %}{% if result.content %}{{ result.content|safe }}<br class="last"/>{% endif %}</p>
13− {% if result.content %}{{ result.content|safe }}<br class="last"/>{% endif %}</p>
14 </div>
12 </div>
15</div>
13</div>
searx/tests/test_webapp.py+9−1
@@ -43,6 +43,8 @@ class ViewsTestCase(SearxTestCase):
43 def test_index_html(self, search):
43 def test_index_html(self, search):
44 search.return_value = (
44 search.return_value = (
45 self.test_results,
45 self.test_results,
46+ set(),
47+ set(),
46 set()
48 set()
47 )
49 )
48 result = self.app.post('/', data={'q': 'test'})
50 result = self.app.post('/', data={'q': 'test'})
@@ -51,7 +53,7 @@ class ViewsTestCase(SearxTestCase):
51 result.data
53 result.data
52 )
54 )
53 self.assertIn(
55 self.assertIn(
54− '<p class="content">first <span class="highlight">test</span> content<br /></p>', # noqa
56+ '<p class="content">first <span class="highlight">test</span> content<br class="last"/></p>', # noqa
55 result.data
57 result.data
56 )
58 )
57
59
@@ -59,6 +61,8 @@ class ViewsTestCase(SearxTestCase):
59 def test_index_json(self, search):
61 def test_index_json(self, search):
60 search.return_value = (
62 search.return_value = (
61 self.test_results,
63 self.test_results,
64+ set(),
65+ set(),
62 set()
66 set()
63 )
67 )
64 result = self.app.post('/', data={'q': 'test', 'format': 'json'})
68 result = self.app.post('/', data={'q': 'test', 'format': 'json'})
@@ -75,6 +79,8 @@ class ViewsTestCase(SearxTestCase):
75 def test_index_csv(self, search):
79 def test_index_csv(self, search):
76 search.return_value = (
80 search.return_value = (
77 self.test_results,
81 self.test_results,
82+ set(),
83+ set(),
78 set()
84 set()
79 )
85 )
80 result = self.app.post('/', data={'q': 'test', 'format': 'csv'})
86 result = self.app.post('/', data={'q': 'test', 'format': 'csv'})
@@ -90,6 +96,8 @@ class ViewsTestCase(SearxTestCase):
90 def test_index_rss(self, search):
96 def test_index_rss(self, search):
91 search.return_value = (
97 search.return_value = (
92 self.test_results,
98 self.test_results,
99+ set(),
100+ set(),
93 set()
101 set()
94 )
102 )
95 result = self.app.post('/', data={'q': 'test', 'format': 'rss'})
103 result = self.app.post('/', data={'q': 'test', 'format': 'rss'})