diff options
| author | Alexandre Flament <alex@al-f.net> | 2021-02-05 10:55:37 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-02-05 10:55:37 +0100 |
| commit | 1e35c3ccce217df6f718034d47760fe9e42fa4bc (patch) | |
| tree | 6c79284801233a2edc14716e82c0df46516794a6 /tests/unit | |
| parent | 321788f14a8a674984b9884094dd9626d6162a33 (diff) | |
| parent | c937a9e85f510820f7d9b98666dcf83f72f80ceb (diff) | |
Merge pull request #2531 from MarcAbonce/fix-browser-locale
[fix] Get correct locale with country from browser
Diffstat (limited to 'tests/unit')
| -rw-r--r-- | tests/unit/test_webapp.py | 14 |
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) |