From 894999a14ef1b295673ef5f2063b043b2a15b769 Mon Sep 17 00:00:00 2001 From: Simon Willison Date: Mon, 14 Sep 2020 13:25:09 -0700 Subject: [PATCH] Improved test for JSON POST, refs #880 --- tests/test_canned_queries.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tests/test_canned_queries.py b/tests/test_canned_queries.py index abf9c5bf..3b1f40bd 100644 --- a/tests/test_canned_queries.py +++ b/tests/test_canned_queries.py @@ -167,11 +167,13 @@ def test_vary_header(canned_write_client): def test_json_post_body(canned_write_client): response = canned_write_client.post( "/data/add_name", - body=json.dumps({"name": "Hello"}), + body=json.dumps({"name": ["Hello", "there"]}), allow_redirects=False, ) assert 302 == response.status assert "/data/add_name?success" == response.headers["Location"] + rows = canned_write_client.get("/data/names.json?_shape=array").json + assert rows == [{"rowid": 1, "name": "['Hello', 'there']"}] def test_canned_query_permissions_on_database_page(canned_write_client):