diff options
author | marc <a01200356@itesm.mx> | 2017-07-04 22:29:06 -0500 |
---|---|---|
committer | Adam Tauber <asciimoo@gmail.com> | 2017-07-10 18:41:50 +0200 |
commit | 405e5c8f24d7e9eee45d830e229570f459e25847 (patch) | |
tree | d315981cf3861a7a5f6dac9c86e786765a5a8604 /tests | |
parent | 38d6ba4066a474c1b13e7ccb6f9ea92b43702a4a (diff) | |
download | searxng-405e5c8f24d7e9eee45d830e229570f459e25847.tar.gz searxng-405e5c8f24d7e9eee45d830e229570f459e25847.zip |
[fix] duckduckgo images doesn't fail with countryless language
Diffstat (limited to 'tests')
-rw-r--r-- | tests/unit/engines/test_duckduckgo_images.py | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/tests/unit/engines/test_duckduckgo_images.py b/tests/unit/engines/test_duckduckgo_images.py index 5f94e3c2b..a8a57c7fd 100644 --- a/tests/unit/engines/test_duckduckgo_images.py +++ b/tests/unit/engines/test_duckduckgo_images.py @@ -8,6 +8,8 @@ from searx.testing import SearxTestCase class TestDuckduckgoImagesEngine(SearxTestCase): def test_request(self): + duckduckgo_images.supported_languages = ['de-CH', 'en-US'] + query = 'test_query' dicto = defaultdict(dict) dicto['is_test'] = True @@ -22,14 +24,16 @@ class TestDuckduckgoImagesEngine(SearxTestCase): self.assertIn('p=-1', params['url']) self.assertIn('vqd=12345', params['url']) - # test paging and safe search + # test paging, safe search and language dicto['pageno'] = 2 dicto['safesearch'] = 2 + dicto['language'] = 'de' params = duckduckgo_images.request(query, dicto) self.assertIn('url', params) self.assertIn(query, params['url']) self.assertIn('s=50', params['url']) self.assertIn('p=1', params['url']) + self.assertIn('ch-de', params['url']) def test_response(self): self.assertRaises(AttributeError, duckduckgo_images.response, None) |