superset-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From maximebeauche...@apache.org
Subject [incubator-superset] branch master updated: Fixes #3134 by correct response content-type of /testconn (#3135)
Date Sat, 15 Jul 2017 16:52:41 GMT
This is an automated email from the ASF dual-hosted git repository.

maximebeauchemin pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-superset.git


The following commit(s) were added to refs/heads/master by this push:
     new e834154  Fixes #3134 by correct response content-type of /testconn (#3135)
e834154 is described below

commit e834154030c5c554443ea73770dfbf6c965a826c
Author: Ke Zhu <shawnzhu@users.noreply.github.com>
AuthorDate: Sat Jul 15 12:52:38 2017 -0400

    Fixes #3134 by correct response content-type of /testconn (#3135)
---
 superset/views/core.py | 2 +-
 tests/core_tests.py    | 2 ++
 2 files changed, 3 insertions(+), 1 deletion(-)

diff --git a/superset/views/core.py b/superset/views/core.py
index 8a5de06..dec49ed 100755
--- a/superset/views/core.py
+++ b/superset/views/core.py
@@ -1374,7 +1374,7 @@ class Superset(BaseSupersetView):
                 .get('connect_args', {}))
             engine = create_engine(uri, connect_args=connect_args)
             engine.connect()
-            return json.dumps(engine.table_names(), indent=4)
+            return json_success(json.dumps(engine.table_names(), indent=4))
         except Exception as e:
             logging.exception(e)
             return json_error_response((
diff --git a/tests/core_tests.py b/tests/core_tests.py
index 7ff48a9..f3e9887 100644
--- a/tests/core_tests.py
+++ b/tests/core_tests.py
@@ -284,6 +284,7 @@ class CoreTests(SupersetTestCase):
         })
         response = self.client.post('/superset/testconn', data=data, content_type='application/json')
         assert response.status_code == 200
+        assert response.headers['Content-Type'] == 'application/json'
 
         # validate that the endpoint works with the decrypted sqlalchemy uri
         data = json.dumps({
@@ -292,6 +293,7 @@ class CoreTests(SupersetTestCase):
         })
         response = self.client.post('/superset/testconn', data=data, content_type='application/json')
         assert response.status_code == 200
+        assert response.headers['Content-Type'] == 'application/json'
 
     def test_databaseview_edit(self, username='admin'):
         # validate that sending a password-masked uri does not over-write the decrypted uri

-- 
To stop receiving notification emails like this one, please contact
['"commits@superset.apache.org" <commits@superset.apache.org>'].

Mime
View raw message