|
@@ -52,23 +52,39 @@ class SelfIPTest(SearxTestCase):
|
52
|
52
|
request = Mock(user_plugins=store.plugins,
|
53
|
53
|
remote_addr='127.0.0.1')
|
54
|
54
|
request.headers.getlist.return_value = []
|
55
|
|
- ctx = get_search_mock(query='ip')
|
|
55
|
+ ctx = get_search_mock(query='ip', pageno=1)
|
56
|
56
|
store.call('post_search', request, ctx)
|
57
|
57
|
self.assertTrue('127.0.0.1' in ctx['search'].result_container.answers)
|
58
|
58
|
|
|
59
|
+ ctx = get_search_mock(query='ip', pageno=2)
|
|
60
|
+ store.call('post_search', request, ctx)
|
|
61
|
+ self.assertFalse('127.0.0.1' in ctx['search'].result_container.answers)
|
|
62
|
+
|
59
|
63
|
# User agent test
|
60
|
64
|
request = Mock(user_plugins=store.plugins,
|
61
|
65
|
user_agent='Mock')
|
62
|
66
|
request.headers.getlist.return_value = []
|
63
|
67
|
|
64
|
|
- ctx = get_search_mock(query='user-agent')
|
|
68
|
+ ctx = get_search_mock(query='user-agent', pageno=1)
|
65
|
69
|
store.call('post_search', request, ctx)
|
66
|
70
|
self.assertTrue('Mock' in ctx['search'].result_container.answers)
|
67
|
71
|
|
68
|
|
- ctx = get_search_mock(query='user-agent')
|
|
72
|
+ ctx = get_search_mock(query='user-agent', pageno=2)
|
|
73
|
+ store.call('post_search', request, ctx)
|
|
74
|
+ self.assertFalse('Mock' in ctx['search'].result_container.answers)
|
|
75
|
+
|
|
76
|
+ ctx = get_search_mock(query='user-agent', pageno=1)
|
69
|
77
|
store.call('post_search', request, ctx)
|
70
|
78
|
self.assertTrue('Mock' in ctx['search'].result_container.answers)
|
71
|
79
|
|
72
|
|
- ctx = get_search_mock(query='What is my User-Agent?')
|
|
80
|
+ ctx = get_search_mock(query='user-agent', pageno=2)
|
|
81
|
+ store.call('post_search', request, ctx)
|
|
82
|
+ self.assertFalse('Mock' in ctx['search'].result_container.answers)
|
|
83
|
+
|
|
84
|
+ ctx = get_search_mock(query='What is my User-Agent?', pageno=1)
|
73
|
85
|
store.call('post_search', request, ctx)
|
74
|
86
|
self.assertTrue('Mock' in ctx['search'].result_container.answers)
|
|
87
|
+
|
|
88
|
+ ctx = get_search_mock(query='What is my User-Agent?', pageno=2)
|
|
89
|
+ store.call('post_search', request, ctx)
|
|
90
|
+ self.assertFalse('Mock' in ctx['search'].result_container.answers)
|