summaryrefslogtreecommitdiff
path: root/searx/tests
diff options
context:
space:
mode:
authorAdam Tauber <asciimoo@gmail.com>2015-12-22 20:05:42 +0100
committerAdam Tauber <asciimoo@gmail.com>2015-12-22 20:05:42 +0100
commit5cea4f9445e2b08fe91f9b964cc768920aac7dc8 (patch)
tree2a1575154cbe1ba9ccf97818403f0f41a3473b2d /searx/tests
parent029291eca18f08061500194b4e1369c43797739c (diff)
downloadsearxng-5cea4f9445e2b08fe91f9b964cc768920aac7dc8.tar.gz
searxng-5cea4f9445e2b08fe91f9b964cc768920aac7dc8.zip
[fix] prevent google engine to redirect
nid/pref cookies are also removed
Diffstat (limited to 'searx/tests')
-rw-r--r--searx/tests/engines/test_google.py6
1 files changed, 1 insertions, 5 deletions
diff --git a/searx/tests/engines/test_google.py b/searx/tests/engines/test_google.py
index 39258e50c..04f12b830 100644
--- a/searx/tests/engines/test_google.py
+++ b/searx/tests/engines/test_google.py
@@ -9,7 +9,7 @@ from searx.testing import SearxTestCase
class TestGoogleEngine(SearxTestCase):
def mock_response(self, text):
- response = mock.Mock(text=text, url='https://www.google.com/search?q=test&start=0&gbv=1')
+ response = mock.Mock(text=text, url='https://www.google.com/search?q=test&start=0&gbv=1&gws_rd=cr')
response.search_params = mock.Mock()
response.search_params.get = mock.Mock(return_value='www.google.com')
return response
@@ -23,16 +23,12 @@ class TestGoogleEngine(SearxTestCase):
self.assertIn('url', params)
self.assertIn(query, params['url'])
self.assertIn('google.fr', params['url'])
- self.assertNotIn('PREF', params['cookies'])
- self.assertIn('NID', params['cookies'])
self.assertIn('fr', params['headers']['Accept-Language'])
dicto['language'] = 'all'
params = google.request(query, dicto)
self.assertIn('google.com', params['url'])
self.assertIn('en', params['headers']['Accept-Language'])
- # self.assertIn('PREF', params['cookies'])
- self.assertIn('NID', params['cookies'])
def test_response(self):
self.assertRaises(AttributeError, google.response, None)