浏览代码

[fix] infoboxes and answers : pass all tests

dalf 10 年前
父节点
当前提交
728fc611da
共有 2 个文件被更改,包括 10 次插入4 次删除
  1. 1
    3
      searx/templates/default/result_templates/default.html
  2. 9
    1
      searx/tests/test_webapp.py

+ 1
- 3
searx/templates/default/result_templates/default.html 查看文件

@@ -8,8 +8,6 @@
8 8
     <h3 class="result_title"><a href="{{ result.url }}">{{ result.title|safe }}</a></h3>
9 9
     <p class="url">{{ result.pretty_url }} <a class="cache_link" href="https://web.archive.org/web/{{ result.url }}">cached</a></p>
10 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 %}
13
-      {% if result.content %}{{ result.content|safe }}<br class="last"/>{% endif %}</p>
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>
14 12
   </div>
15 13
 </div>

+ 9
- 1
searx/tests/test_webapp.py 查看文件

@@ -43,6 +43,8 @@ class ViewsTestCase(SearxTestCase):
43 43
     def test_index_html(self, search):
44 44
         search.return_value = (
45 45
             self.test_results,
46
+            set(),
47
+            set(),
46 48
             set()
47 49
         )
48 50
         result = self.app.post('/', data={'q': 'test'})
@@ -51,7 +53,7 @@ class ViewsTestCase(SearxTestCase):
51 53
             result.data
52 54
         )
53 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 57
             result.data
56 58
         )
57 59
 
@@ -59,6 +61,8 @@ class ViewsTestCase(SearxTestCase):
59 61
     def test_index_json(self, search):
60 62
         search.return_value = (
61 63
             self.test_results,
64
+            set(),
65
+            set(),
62 66
             set()
63 67
         )
64 68
         result = self.app.post('/', data={'q': 'test', 'format': 'json'})
@@ -75,6 +79,8 @@ class ViewsTestCase(SearxTestCase):
75 79
     def test_index_csv(self, search):
76 80
         search.return_value = (
77 81
             self.test_results,
82
+            set(),
83
+            set(),
78 84
             set()
79 85
         )
80 86
         result = self.app.post('/', data={'q': 'test', 'format': 'csv'})
@@ -90,6 +96,8 @@ class ViewsTestCase(SearxTestCase):
90 96
     def test_index_rss(self, search):
91 97
         search.return_value = (
92 98
             self.test_results,
99
+            set(),
100
+            set(),
93 101
             set()
94 102
         )
95 103
         result = self.app.post('/', data={'q': 'test', 'format': 'rss'})