@@ -25,6 +25,32 @@ def test_message_call_method(client):
2525 assert response ["data" ].get ("method_count" ) == 1
2626
2727
28+ def test_message_call_method_with_dictionary_checksum (client ):
29+ data = {"dictionary" : {"1" : "test" , "2" : "anothertest" , "3" : "" , "4" : "moretest" }}
30+ message = {
31+ "actionQueue" : [
32+ {
33+ "payload" : {"name" : "test_method" },
34+ "type" : "callMethod" ,
35+ }
36+ ],
37+ "data" : data ,
38+ "checksum" : generate_checksum (str (data )),
39+ "id" : shortuuid .uuid ()[:8 ],
40+ "epoch" : time .time (),
41+ }
42+
43+ response = client .post (
44+ "/message/tests.views.fake_components.FakeComponentWithDictionary" ,
45+ message ,
46+ content_type = "application/json" ,
47+ )
48+
49+ body = orjson .loads (response .content )
50+
51+ assert not body ["errors" ]
52+
53+
2854def test_message_call_method_redirect (client ):
2955 data = {}
3056 message = {
@@ -35,7 +61,7 @@ def test_message_call_method_redirect(client):
3561 }
3662 ],
3763 "data" : data ,
38- "checksum" : generate_checksum (orjson . dumps (data )),
64+ "checksum" : generate_checksum (str (data )),
3965 "id" : shortuuid .uuid ()[:8 ],
4066 "epoch" : time .time (),
4167 }
@@ -64,7 +90,7 @@ def test_message_call_method_refresh_redirect(client):
6490 }
6591 ],
6692 "data" : data ,
67- "checksum" : generate_checksum (orjson . dumps (data )),
93+ "checksum" : generate_checksum (str (data )),
6894 "id" : shortuuid .uuid ()[:8 ],
6995 "epoch" : time .time (),
7096 }
@@ -94,7 +120,7 @@ def test_message_call_method_hash_update(client):
94120 }
95121 ],
96122 "data" : data ,
97- "checksum" : generate_checksum (orjson . dumps (data )),
123+ "checksum" : generate_checksum (str (data )),
98124 "id" : shortuuid .uuid ()[:8 ],
99125 "epoch" : time .time (),
100126 }
@@ -121,7 +147,7 @@ def test_message_call_method_return_value(client):
121147 }
122148 ],
123149 "data" : data ,
124- "checksum" : generate_checksum (orjson . dumps (data )),
150+ "checksum" : generate_checksum (str (data )),
125151 "id" : shortuuid .uuid ()[:8 ],
126152 "epoch" : time .time (),
127153 }
@@ -152,7 +178,7 @@ def test_message_call_method_poll_update(client):
152178 }
153179 ],
154180 "data" : data ,
155- "checksum" : generate_checksum (orjson . dumps (data )),
181+ "checksum" : generate_checksum (str (data )),
156182 "id" : shortuuid .uuid ()[:8 ],
157183 "epoch" : time .time (),
158184 }
@@ -182,7 +208,7 @@ def test_message_call_method_setter(client):
182208 }
183209 ],
184210 "data" : data ,
185- "checksum" : generate_checksum (orjson . dumps (data )),
211+ "checksum" : generate_checksum (str (data )),
186212 "id" : shortuuid .uuid ()[:8 ],
187213 "epoch" : time .time (),
188214 }
@@ -208,7 +234,7 @@ def test_message_call_method_nested_setter(client):
208234 }
209235 ],
210236 "data" : data ,
211- "checksum" : generate_checksum (orjson . dumps (data )),
237+ "checksum" : generate_checksum (str (data )),
212238 "id" : shortuuid .uuid ()[:8 ],
213239 "epoch" : time .time (),
214240 }
@@ -234,7 +260,7 @@ def test_message_call_method_multiple_nested_setter(client):
234260 }
235261 ],
236262 "data" : data ,
237- "checksum" : generate_checksum (orjson . dumps (data )),
263+ "checksum" : generate_checksum (str (data )),
238264 "id" : shortuuid .uuid ()[:8 ],
239265 "epoch" : time .time (),
240266 }
@@ -260,7 +286,7 @@ def test_message_call_method_toggle(client):
260286 }
261287 ],
262288 "data" : data ,
263- "checksum" : generate_checksum (orjson . dumps (data )),
289+ "checksum" : generate_checksum (str (data )),
264290 "id" : shortuuid .uuid ()[:8 ],
265291 "epoch" : time .time (),
266292 }
@@ -286,7 +312,7 @@ def test_message_call_method_nested_toggle(client):
286312 }
287313 ],
288314 "data" : data ,
289- "checksum" : generate_checksum (orjson . dumps (data )),
315+ "checksum" : generate_checksum (str (data )),
290316 "id" : shortuuid .uuid ()[:8 ],
291317 "epoch" : time .time (),
292318 }
@@ -312,7 +338,7 @@ def test_message_call_method_args(client):
312338 }
313339 ],
314340 "data" : data ,
315- "checksum" : generate_checksum (orjson . dumps (data )),
341+ "checksum" : generate_checksum (str (data )),
316342 "id" : shortuuid .uuid ()[:8 ],
317343 "epoch" : time .time (),
318344 }
@@ -338,7 +364,7 @@ def test_message_call_method_kwargs(client):
338364 }
339365 ],
340366 "data" : data ,
341- "checksum" : generate_checksum (orjson . dumps (data )),
367+ "checksum" : generate_checksum (str (data )),
342368 "id" : shortuuid .uuid ()[:8 ],
343369 "epoch" : time .time (),
344370 }
@@ -364,7 +390,7 @@ def test_message_call_method_no_validation(client):
364390 }
365391 ],
366392 "data" : data ,
367- "checksum" : generate_checksum (orjson . dumps (data )),
393+ "checksum" : generate_checksum (str (data )),
368394 "id" : shortuuid .uuid ()[:8 ],
369395 "epoch" : time .time (),
370396 }
@@ -390,7 +416,7 @@ def test_message_call_method_validation(client):
390416 }
391417 ],
392418 "data" : data ,
393- "checksum" : generate_checksum (orjson . dumps (data )),
419+ "checksum" : generate_checksum (str (data )),
394420 "id" : shortuuid .uuid ()[:8 ],
395421 "epoch" : time .time (),
396422 }
@@ -420,7 +446,7 @@ def test_message_call_method_reset(client):
420446 },
421447 ],
422448 "data" : data ,
423- "checksum" : generate_checksum (orjson . dumps (data )),
449+ "checksum" : generate_checksum (str (data )),
424450 "id" : shortuuid .uuid ()[:8 ],
425451 "epoch" : time .time (),
426452 }
@@ -449,7 +475,7 @@ def test_message_call_method_refresh(client):
449475 },
450476 ],
451477 "data" : data ,
452- "checksum" : generate_checksum (orjson . dumps (data )),
478+ "checksum" : generate_checksum (str (data )),
453479 "id" : shortuuid .uuid ()[:8 ],
454480 "epoch" : time .time (),
455481 }
0 commit comments