@@ -74,7 +74,11 @@ def test_form_response(token, client, connection, schemas_simple):
7474 "type" : "attribute" ,
7575 "default" : None ,
7676 },
77- {"name" : "Table A" , "type" : "table" , "values" : [{"A Id" : 0 }, {"A Id" : 1 }]},
77+ {
78+ "name" : "Table A" ,
79+ "type" : "table" ,
80+ "values" : ['{"A Id": 0}' , '{"A Id": 1}' ],
81+ },
7882 {"datatype" : "int" , "name" : "C Id" , "type" : "attribute" , "default" : None },
7983 {
8084 "datatype" : "varchar(30)" ,
@@ -101,7 +105,11 @@ def test_form_response_no_table_map(token, client, connection, schemas_simple):
101105 "type" : "attribute" ,
102106 "default" : None ,
103107 },
104- {"name" : "Table A" , "type" : "table" , "values" : [{"a_id" : 0 }, {"a_id" : 1 }]},
108+ {
109+ "name" : "Table A" ,
110+ "type" : "table" ,
111+ "values" : ['{"a_id": 0}' , '{"a_id": 1}' ],
112+ },
105113 {"datatype" : "int" , "name" : "C Id" , "type" : "attribute" , "default" : None },
106114 {
107115 "datatype" : "varchar(30)" ,
@@ -124,7 +132,7 @@ def test_form_response_no_map(token, client, connection, schemas_simple):
124132 {
125133 "name" : "test_group1_simple.TableA" ,
126134 "type" : "table" ,
127- "values" : [{"a_id" : 0 }, {"a_id" : 1 }],
135+ "values" : [' {"a_id": 0}' , ' {"a_id": 1}' ],
128136 },
129137 {"datatype" : "int" , "name" : "b_id" , "type" : "attribute" , "default" : None },
130138 {
@@ -157,15 +165,15 @@ def test_form_response_no_map_shared_FK_hierarchy(
157165 {
158166 "name" : "test_group1_simple.TableA" ,
159167 "type" : "table" ,
160- "values" : [{"a_id" : 0 }, {"a_id" : 1 }],
168+ "values" : [' {"a_id": 0}' , ' {"a_id": 1}' ],
161169 },
162170 {
163171 "name" : "test_group1_simple.TableB" ,
164172 "type" : "table" ,
165173 "values" : [
166- {"a_id" : 0 , "b_id" : 10 },
167- {"a_id" : 0 , "b_id" : 11 },
168- {"a_id" : 1 , "b_id" : 21 },
174+ ' {"a_id": 0, "b_id": 10}' ,
175+ ' {"a_id": 0, "b_id": 11}' ,
176+ ' {"a_id": 1, "b_id": 21}' ,
169177 ],
170178 },
171179 {"datatype" : "int" , "name" : "bs_id" , "type" : "attribute" , "default" : None },
@@ -197,7 +205,7 @@ def test_form_response_no_map_shared_FK(token, client, connection, schemas_simpl
197205 {
198206 "name" : "test_group1_simple.TableA" ,
199207 "type" : "table" ,
200- "values" : [{"a_id" : 0 }, {"a_id" : 1 }],
208+ "values" : [' {"a_id": 0}' , ' {"a_id": 1}' ],
201209 },
202210 {"datatype" : "int" , "name" : "b_id" , "type" : "attribute" , "default" : None },
203211 {
@@ -228,12 +236,12 @@ def test_form_response_no_map_diff_FK(token, client, connection, schemas_simple)
228236 {
229237 "name" : "test_group3_simple.TableZ" ,
230238 "type" : "table" ,
231- "values" : [{"z_id" : 0 }, {"z_id" : 1 }],
239+ "values" : [' {"z_id": 0}' , ' {"z_id": 1}' ],
232240 },
233241 {
234242 "name" : "test_group4_simple.DiffTableZ" ,
235243 "type" : "table" ,
236- "values" : [{"zs_id" : 0 }, {"zs_id" : 1 }],
244+ "values" : [' {"zs_id": 0}' , ' {"zs_id": 1}' ],
237245 },
238246 {"datatype" : "int" , "name" : "y_id" , "type" : "attribute" , "default" : None },
239247 {
@@ -265,8 +273,8 @@ def test_form_response_no_map_multi_FPK(token, client, connection, schemas_simpl
265273 "name" : "test_group3_simple.TableX" ,
266274 "type" : "table" ,
267275 "values" : [
268- {"x_id" : 0 , "x_int " : 10 , "x_name " : "Carlos" } ,
269- {"x_id" : 1 , "x_int " : 20 , "x_name " : "Oscar" } ,
276+ ' {"x_id": 0, "x_name ": "Carlos" , "x_int ": 10}' ,
277+ ' {"x_id": 1, "x_name ": "Oscar" , "x_int ": 20}' ,
270278 ],
271279 },
272280 {"datatype" : "int" , "name" : "w_id" , "type" : "attribute" , "default" : None },
@@ -286,25 +294,25 @@ def test_form_response_no_map_many_tables(token, client, connection, schemas_sim
286294 {
287295 "name" : "test_group1_simple.TableA" ,
288296 "type" : "table" ,
289- "values" : [{"a_id" : 0 }, {"a_id" : 1 }],
297+ "values" : [' {"a_id": 0}' , ' {"a_id": 1}' ],
290298 },
291299 {
292300 "name" : "test_group3_simple.TableX" ,
293301 "type" : "table" ,
294302 "values" : [
295- {"x_id" : 0 , "x_int " : 10 , "x_name " : "Carlos" } ,
296- {"x_id" : 1 , "x_int " : 20 , "x_name " : "Oscar" } ,
303+ ' {"x_id": 0, "x_name ": "Carlos" , "x_int ": 10}' ,
304+ ' {"x_id": 1, "x_name ": "Oscar" , "x_int ": 20}' ,
297305 ],
298306 },
299307 {
300308 "name" : "test_group3_simple.TableZ" ,
301309 "type" : "table" ,
302- "values" : [{"z_id" : 0 }, {"z_id" : 1 }],
310+ "values" : [' {"z_id": 0}' , ' {"z_id": 1}' ],
303311 },
304312 {
305313 "name" : "test_group4_simple.DiffTableZ" ,
306314 "type" : "table" ,
307- "values" : [{"zs_id" : 0 }, {"zs_id" : 1 }],
315+ "values" : [' {"zs_id": 0}' , ' {"zs_id": 1}' ],
308316 },
309317 {"datatype" : "int" , "name" : "b_id" , "type" : "attribute" , "default" : None },
310318 {
@@ -345,3 +353,24 @@ def test_form_response_no_map_many_tables(token, client, connection, schemas_sim
345353 {"datatype" : "int" , "name" : "w_int" , "type" : "attribute" , "default" : "123" },
346354 ]
347355 }
356+
357+
358+ def test_form_datetime_FPK (token , client , connection , schemas_simple ):
359+ REST_response = client .get (
360+ "/insert9/fields" ,
361+ headers = dict (Authorization = f"Bearer { token } " ),
362+ )
363+ assert REST_response .status_code == 200 , f"Error: { REST_response .data } "
364+ assert REST_response .get_json () == {
365+ "fields" : [
366+ {
367+ "name" : "test_group4_simple.TableV" ,
368+ "type" : "table" ,
369+ "values" : [
370+ '{"datetime": "2000-01-02T01:02:03", "v_int": 0}' ,
371+ '{"datetime": "2023-12-01T23:12:01", "v_int": 1}' ,
372+ ],
373+ },
374+ {"datatype" : "int" , "default" : "1" , "name" : "u_int" , "type" : "attribute" },
375+ ]
376+ }
0 commit comments