mirror of
https://github.com/apache/superset.git
synced 2026-05-09 01:46:06 +00:00
fix: error while parsing invalid json form_data (#12586)
* Fix error while parsing invalid json form_data * Refine error returned
This commit is contained in:
committed by
Daniel Gaspar
parent
233135e8ec
commit
d237cd63c0
@@ -923,7 +923,7 @@ class TestUtils(SupersetTestCase):
|
||||
|
||||
self.assertEqual(
|
||||
form_data,
|
||||
{"time_range_endpoints": get_time_range_endpoints(form_data={}),},
|
||||
{"time_range_endpoints": get_time_range_endpoints(form_data={})},
|
||||
)
|
||||
|
||||
self.assertEqual(slc, None)
|
||||
@@ -992,6 +992,20 @@ class TestUtils(SupersetTestCase):
|
||||
|
||||
self.assertEqual(slc, None)
|
||||
|
||||
def test_get_form_data_corrupted_json(self) -> None:
|
||||
with app.test_request_context(
|
||||
data={"form_data": "{x: '2324'}"},
|
||||
query_string={"form_data": '{"baz": "bar"'},
|
||||
):
|
||||
form_data, slc = get_form_data()
|
||||
|
||||
self.assertEqual(
|
||||
form_data,
|
||||
{"time_range_endpoints": get_time_range_endpoints(form_data={})},
|
||||
)
|
||||
|
||||
self.assertEqual(slc, None)
|
||||
|
||||
@pytest.mark.usefixtures("load_birth_names_dashboard_with_slices")
|
||||
def test_log_this(self) -> None:
|
||||
# TODO: Add additional scenarios.
|
||||
|
||||
Reference in New Issue
Block a user