diff options
author | Adam Tauber <asciimoo@gmail.com> | 2016-08-27 22:10:33 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-08-27 22:10:33 +0200 |
commit | 7591c8bfe314b82262c49373e7c26fe5c333d671 (patch) | |
tree | 1ad8dfc8073f22ae082eaa1280575d4bfcf9c7fe /tests | |
parent | 3043c404e42901a1234d150e43daee99810b46f5 (diff) | |
parent | aa227180e2e7b720d932d75d6fc86fb7417ef158 (diff) | |
download | searxng-7591c8bfe314b82262c49373e7c26fe5c333d671.tar.gz searxng-7591c8bfe314b82262c49373e7c26fe5c333d671.zip |
Merge pull request #672 from kvch/self-info-paging
Self information on later pages
Diffstat (limited to 'tests')
-rw-r--r-- | tests/unit/test_plugins.py | 24 |
1 files changed, 20 insertions, 4 deletions
diff --git a/tests/unit/test_plugins.py b/tests/unit/test_plugins.py index 98d39ec14..b8a8980cf 100644 --- a/tests/unit/test_plugins.py +++ b/tests/unit/test_plugins.py @@ -52,23 +52,39 @@ class SelfIPTest(SearxTestCase): request = Mock(user_plugins=store.plugins, remote_addr='127.0.0.1') request.headers.getlist.return_value = [] - ctx = get_search_mock(query='ip') + ctx = get_search_mock(query='ip', pageno=1) store.call('post_search', request, ctx) self.assertTrue('127.0.0.1' in ctx['search'].result_container.answers) + ctx = get_search_mock(query='ip', pageno=2) + store.call('post_search', request, ctx) + self.assertFalse('127.0.0.1' in ctx['search'].result_container.answers) + # User agent test request = Mock(user_plugins=store.plugins, user_agent='Mock') request.headers.getlist.return_value = [] - ctx = get_search_mock(query='user-agent') + ctx = get_search_mock(query='user-agent', pageno=1) store.call('post_search', request, ctx) self.assertTrue('Mock' in ctx['search'].result_container.answers) - ctx = get_search_mock(query='user-agent') + ctx = get_search_mock(query='user-agent', pageno=2) + store.call('post_search', request, ctx) + self.assertFalse('Mock' in ctx['search'].result_container.answers) + + ctx = get_search_mock(query='user-agent', pageno=1) store.call('post_search', request, ctx) self.assertTrue('Mock' in ctx['search'].result_container.answers) - ctx = get_search_mock(query='What is my User-Agent?') + ctx = get_search_mock(query='user-agent', pageno=2) + store.call('post_search', request, ctx) + self.assertFalse('Mock' in ctx['search'].result_container.answers) + + ctx = get_search_mock(query='What is my User-Agent?', pageno=1) store.call('post_search', request, ctx) self.assertTrue('Mock' in ctx['search'].result_container.answers) + + ctx = get_search_mock(query='What is my User-Agent?', pageno=2) + store.call('post_search', request, ctx) + self.assertFalse('Mock' in ctx['search'].result_container.answers) |