From 97351a2c725ce620d452c62da07379130bafdb95 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?No=C3=A9mi=20V=C3=A1nyi?= Date: Mon, 7 Jan 2019 21:28:58 +0100 Subject: [PATCH] fix after rebase --- searx/engines/wikipedia.py | 2 +- tests/unit/engines/test_wikipedia.py | 3 --- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/searx/engines/wikipedia.py b/searx/engines/wikipedia.py index 39aec1c81..4dae735d1 100644 --- a/searx/engines/wikipedia.py +++ b/searx/engines/wikipedia.py @@ -32,7 +32,7 @@ supported_languages_url = 'https://meta.wikimedia.org/wiki/List_of_Wikipedias' # set language in base_url def url_lang(lang): lang_pre = lang.split('-')[0] - if lang_pre == 'all' or lang_pre not in supported_languages: + if lang_pre == 'all' or lang_pre not in supported_languages and lang_pre not in language_aliases: return 'en' return match_language(lang, supported_languages, language_aliases).split('-')[0] diff --git a/tests/unit/engines/test_wikipedia.py b/tests/unit/engines/test_wikipedia.py index 93b3a5ab1..316b12bc5 100644 --- a/tests/unit/engines/test_wikipedia.py +++ b/tests/unit/engines/test_wikipedia.py @@ -26,15 +26,12 @@ class TestWikipediaEngine(SearxTestCase): self.assertIn('Test_Query', params['url']) self.assertNotIn('test_query', params['url']) -<<<<<<< HEAD dicto['language'] = 'nb' params = wikipedia.request(query, dicto) self.assertIn('no.wikipedia.org', params['url']) -======= dicto['language'] = 'all' params = wikipedia.request(query, dicto) self.assertIn('en', params['url']) ->>>>>>> Revert "remove 'all' option from search languages" dicto['language'] = 'xx' params = wikipedia.request(query, dicto)