summaryrefslogtreecommitdiff
path: root/tests/unit/test_webapp.py
diff options
context:
space:
mode:
Diffstat (limited to 'tests/unit/test_webapp.py')
-rw-r--r--tests/unit/test_webapp.py14
1 files changed, 14 insertions, 0 deletions
diff --git a/tests/unit/test_webapp.py b/tests/unit/test_webapp.py
index 32aa22fb5..a488faf58 100644
--- a/tests/unit/test_webapp.py
+++ b/tests/unit/test_webapp.py
@@ -198,6 +198,20 @@ class ViewsTestCase(SearxTestCase):
result.data
)
+ def test_browser_locale(self):
+ result = self.app.get('/preferences', headers={'Accept-Language': 'zh-tw;q=0.8'})
+ self.assertEqual(result.status_code, 200)
+ self.assertIn(
+ b'<option value="zh_TW" selected="selected">',
+ result.data,
+ 'Interface locale ignored browser preference.'
+ )
+ self.assertIn(
+ b'<option value="zh-TW" selected="selected">',
+ result.data,
+ 'Search language ignored browser preference.'
+ )
+
def test_stats(self):
result = self.app.get('/stats')
self.assertEqual(result.status_code, 200)