You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@superset.apache.org by GitBox <gi...@apache.org> on 2019/05/08 21:48:03 UTC

[GitHub] [incubator-superset] graceguo-supercat commented on a change in pull request #7449: Only allow GET method for explore_json by feature flag

graceguo-supercat commented on a change in pull request #7449: Only allow GET method for explore_json by feature flag
URL: https://github.com/apache/incubator-superset/pull/7449#discussion_r282262614
 
 

 ##########
 File path: tests/core_tests.py
 ##########
 @@ -148,9 +148,22 @@ def test_old_slice_json_endpoint(self):
     def test_slice_json_endpoint(self):
         self.login(username='admin')
         slc = self.get_slice('Girls', db.session)
-        resp = self.get_resp(slc.explore_json_url)
+        # add mock data to trigger POST method
+        resp = self.get_resp(slc.explore_json_url, data={'test': 1})
         assert '"Jennifer"' in resp
 
+    def test_explore_json_endpoint(self):
+        self.login(username='admin')
+        slc = self.get_slice('Girls', db.session)
+
+        # by default, feature CLIENT_CACHE is disabled,
+        # explore_json should not allow GET method
+        resp = self.client.get(slc.explore_json_url)
 
 Review comment:
   I added another case, so now we test enabled csrf protection flag (GET and POST), and disable csrf protection flag (GET and POST).

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org