mirror of https://github.com/searxng/searxng.git
Merge pull request #1590 from rachmadaniHaryono/feature/fix-config
fix: dev: python3 dict keys jsonify
This commit is contained in:
commit
4c768f9fe6
|
@ -846,7 +846,7 @@ def clear_cookies():
|
|||
|
||||
@app.route('/config')
|
||||
def config():
|
||||
return jsonify({'categories': categories.keys(),
|
||||
return jsonify({'categories': list(categories.keys()),
|
||||
'engines': [{'name': engine_name,
|
||||
'categories': engine.categories,
|
||||
'shortcut': engine.shortcut,
|
||||
|
@ -854,7 +854,7 @@ def config():
|
|||
'paging': engine.paging,
|
||||
'language_support': engine.language_support,
|
||||
'supported_languages':
|
||||
engine.supported_languages.keys()
|
||||
list(engine.supported_languages.keys())
|
||||
if isinstance(engine.supported_languages, dict)
|
||||
else engine.supported_languages,
|
||||
'safesearch': engine.safesearch,
|
||||
|
|
|
@ -157,3 +157,9 @@ class ViewsTestCase(SearxTestCase):
|
|||
def test_favicon(self):
|
||||
result = self.app.get('/favicon.ico')
|
||||
self.assertEqual(result.status_code, 200)
|
||||
|
||||
def test_config(self):
|
||||
result = self.app.get('/config')
|
||||
self.assertEqual(result.status_code, 200)
|
||||
json_result = result.get_json()
|
||||
self.assertTrue(json_result)
|
||||
|
|
Loading…
Reference in New Issue