-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Add test for a (multiple) file component inside an edit grid component. Ensures the attachments are properly encoded.
- Loading branch information
1 parent
c7d7f93
commit 5644149
Showing
2 changed files
with
262 additions
and
0 deletions.
There are no files selected for viewing
74 changes: 74 additions & 0 deletions
74
...cassettes/JSONDumpBackendTests/JSONDumpBackendTests.test_file_in_edit_grid_component.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
interactions: | ||
- request: | ||
body: '"{\"values\": {\"repeatingGroup\": [{\"fileUploadInRepeating\": [{\"file_name\": | ||
\"test_file.txt\", \"content\": \"VGhpcyBpcyBleGFtcGxlIGNvbnRlbnQu\"}, {\"file_name\": | ||
\"test_file_2.txt\", \"content\": \"VGhpcyBpcyBleGFtcGxlIGNvbnRlbnQgMi4=\"}]}, | ||
{\"fileUploadInRepeating\": [{\"file_name\": \"test_file_3.txt\", \"content\": | ||
\"VGhpcyBpcyBleGFtcGxlIGNvbnRlbnQgMy4=\"}]}]}, \"schema\": {\"$schema\": \"https://json-schema.org/draft/2020-12/schema\", | ||
\"type\": \"object\", \"properties\": {\"repeatingGroup\": {\"title\": \"Repeating | ||
Group\", \"type\": \"array\", \"items\": {\"type\": \"object\", \"properties\": | ||
{\"fileUploadInRepeating\": {\"title\": \"File upload\", \"type\": \"array\", | ||
\"items\": {\"type\": \"object\", \"properties\": {\"file_name\": {\"type\": | ||
\"string\"}, \"content\": {\"type\": \"string\", \"format\": \"base64\"}}, \"required\": | ||
[\"file_name\", \"content\"], \"additionalProperties\": false}}}, \"required\": | ||
[\"fileUploadInRepeating\"], \"additionalProperties\": false}}}, \"required\": | ||
[\"repeatingGroup\"], \"additionalProperties\": false}}"' | ||
headers: | ||
Accept: | ||
- '*/*' | ||
Accept-Encoding: | ||
- gzip, deflate, br | ||
Authorization: | ||
- Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiIiLCJpYXQiOjE3Mzg2ODUwNDEsImNsaWVudF9pZCI6IiIsInVzZXJfaWQiOiIiLCJ1c2VyX3JlcHJlc2VudGF0aW9uIjoiIn0.TR9VUmpzO52JTC699ibQF8xxbo2Cii9FKak5Bv88Upg | ||
Connection: | ||
- keep-alive | ||
Content-Length: | ||
- '1071' | ||
Content-Type: | ||
- application/json | ||
User-Agent: | ||
- python-requests/2.32.2 | ||
method: POST | ||
uri: http://localhost/json_plugin | ||
response: | ||
body: | ||
string: "{\n \"data\": {\n \"schema\": {\n \"$schema\": \"https://json-schema.org/draft/2020-12/schema\",\n | ||
\ \"additionalProperties\": false,\n \"properties\": {\n \"repeatingGroup\": | ||
{\n \"items\": {\n \"additionalProperties\": false,\n | ||
\ \"properties\": {\n \"fileUploadInRepeating\": {\n | ||
\ \"items\": {\n \"additionalProperties\": | ||
false,\n \"properties\": {\n \"content\": | ||
{\n \"format\": \"base64\",\n \"type\": | ||
\"string\"\n },\n \"file_name\": {\n | ||
\ \"type\": \"string\"\n }\n },\n | ||
\ \"required\": [\n \"file_name\",\n \"content\"\n | ||
\ ],\n \"type\": \"object\"\n },\n | ||
\ \"title\": \"File upload\",\n \"type\": \"array\"\n | ||
\ }\n },\n \"required\": [\n \"fileUploadInRepeating\"\n | ||
\ ],\n \"type\": \"object\"\n },\n \"title\": | ||
\"Repeating Group\",\n \"type\": \"array\"\n }\n },\n | ||
\ \"required\": [\n \"repeatingGroup\"\n ],\n \"type\": | ||
\"object\"\n },\n \"values\": {\n \"repeatingGroup\": [\n {\n | ||
\ \"fileUploadInRepeating\": [\n {\n \"content\": | ||
\"VGhpcyBpcyBleGFtcGxlIGNvbnRlbnQu\",\n \"file_name\": \"test_file.txt\"\n | ||
\ },\n {\n \"content\": \"VGhpcyBpcyBleGFtcGxlIGNvbnRlbnQgMi4=\",\n | ||
\ \"file_name\": \"test_file_2.txt\"\n }\n ]\n | ||
\ },\n {\n \"fileUploadInRepeating\": [\n {\n | ||
\ \"content\": \"VGhpcyBpcyBleGFtcGxlIGNvbnRlbnQgMy4=\",\n \"file_name\": | ||
\"test_file_3.txt\"\n }\n ]\n }\n ]\n }\n | ||
\ },\n \"message\": \"Data received\"\n}\n" | ||
headers: | ||
Connection: | ||
- close | ||
Content-Length: | ||
- '1880' | ||
Content-Type: | ||
- application/json | ||
Date: | ||
- Tue, 04 Feb 2025 16:04:01 GMT | ||
Server: | ||
- Werkzeug/3.1.3 Python/3.12.8 | ||
status: | ||
code: 201 | ||
message: CREATED | ||
version: 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters