diff options
author | marc <a01200356@itesm.mx> | 2016-12-13 23:51:15 -0600 |
---|---|---|
committer | marc <a01200356@itesm.mx> | 2016-12-13 23:51:15 -0600 |
commit | e0c270bd72f7b2a40222e3ed264e25d36cb0fc30 (patch) | |
tree | 2a0d67f6d5874350baf0ec6733e1e1241df2ad1f /tests/unit/engines/test_duckduckgo.py | |
parent | 1b46ecd21a15cdea4234a568e9ac973bb6b65b8a (diff) | |
download | searxng-e0c270bd72f7b2a40222e3ed264e25d36cb0fc30.tar.gz searxng-e0c270bd72f7b2a40222e3ed264e25d36cb0fc30.zip |
tests for language support in engines
Diffstat (limited to 'tests/unit/engines/test_duckduckgo.py')
-rw-r--r-- | tests/unit/engines/test_duckduckgo.py | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/tests/unit/engines/test_duckduckgo.py b/tests/unit/engines/test_duckduckgo.py index b5a4fd4f0..2aeaa1880 100644 --- a/tests/unit/engines/test_duckduckgo.py +++ b/tests/unit/engines/test_duckduckgo.py @@ -19,6 +19,17 @@ class TestDuckduckgoEngine(SearxTestCase): self.assertIn('duckduckgo.com', params['url']) self.assertIn('ch-de', params['url']) + # when ddg uses non standard code + dicto['language'] = 'en-GB' + params = duckduckgo.request(query, dicto) + self.assertIn('uk-en', params['url']) + + # no country given + duckduckgo.supported_languages = ['de-CH', 'en-US'] + dicto['language'] = 'de' + params = duckduckgo.request(query, dicto) + self.assertIn('ch-de', params['url']) + def test_no_url_in_request_year_time_range(self): dicto = defaultdict(dict) query = 'test_query' |