From 28ccf47ca464a0477b5d156f0328ca9d811b2a24 Mon Sep 17 00:00:00 2001 From: Alexandre Flament Date: Tue, 17 Aug 2021 08:18:30 +0200 Subject: [mod] searx.webapp.get_locale: read locale from the preferences pre_request already set the locale. --- tests/unit/test_webapp.py | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'tests') diff --git a/tests/unit/test_webapp.py b/tests/unit/test_webapp.py index 2cbdc83d6..8598113f7 100644 --- a/tests/unit/test_webapp.py +++ b/tests/unit/test_webapp.py @@ -220,6 +220,24 @@ class ViewsTestCase(SearxTestCase): 'Search language ignored browser preference.' ) + def test_brower_empty_locale(self): + result = self.app.get('/preferences', headers={'Accept-Language': ''}) + self.assertEqual(result.status_code, 200) + self.assertIn( + b'