diff options
Diffstat (limited to 'lib/query/tests')
| -rw-r--r-- | lib/query/tests/insert_list.t | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/lib/query/tests/insert_list.t b/lib/query/tests/insert_list.t new file mode 100644 index 0000000..3499bf8 --- /dev/null +++ b/lib/query/tests/insert_list.t @@ -0,0 +1,45 @@ +Insert rows in the lists declared in the configuration, then display the list +tables. Two rows are inserted per list; text and integer fields get a value +derived from the field name, and references point to the row of id 1: + + $ tests --insert_list <<EOF + > { + > "list": [ + > { + > "id": "country_list", + > "field": [ + > { "name": "name", "label": {}, "type": "text" }, + > { "name": "code", "label": {}, "type": "text" } + > ] + > }, + > { + > "id": "user_type_list", + > "field": [ + > { "name": "label", "label": {}, "type": "text" }, + > { "name": "rank", "label": {}, "type": "integer" }, + > { + > "name": "country", + > "label": {}, + > "type": { "content": "country_list" } + > }, + > { + > "name": "aliases", + > "label": {}, + > "type": { "content": "country_list", "multivaluated": true } + > } + > ] + > } + > ], + > "content": [ { "id": "entity" } ] + > } + > EOF + country_list: + {"id":1,"name":"name-1","code":"code-1"} + {"id":2,"name":"name-2","code":"code-2"} + user_type_list: + {"id":1,"label":"label-1","rank":1,"country":1,"country_table":"country_list"} + {"id":2,"label":"label-2","rank":2,"country":1,"country_table":"country_list"} + user_type_list.aliases: + {"parent":1,"target":1,"target_table":"country_list"} + {"parent":1,"target":2,"target_table":"country_list"} + {"parent":2,"target":2,"target_table":"country_list"} |
