@@ -385,36 +385,36 @@ def test_condition_can_be_invoked_for_each_attribute_types(self):
385
385
"value" : self .entry_refs [2 ],
386
386
"will_invoke" : True ,
387
387
},
388
- # {
389
- # "attrname": "named_trigger",
390
- # "value": {"name": "Open Sesame", "id": self.entry_refs[0].id},
391
- # "will_invoke": False,
392
- # },
393
- # {
394
- # "attrname": "named_trigger",
395
- # "value": {"name": "", "id": self.entry_refs[0].id},
396
- # "will_invoke": False,
397
- # },
398
- # {
399
- # "attrname": "named_trigger",
400
- # "value": {"name": "Unexpected words", "id": None},
401
- # "will_invoke": False,
402
- # },
403
- # {
404
- # "attrname": "named_trigger",
405
- # "value": {"name": FAT_LADY_PASSWD, "id": None},
406
- # "will_invoke": True,
407
- # },
408
- # {
409
- # "attrname": "named_trigger",
410
- # "value": {"name": "", "id": self.entry_refs[2].id},
411
- # "will_invoke": True,
412
- # },
413
- # {
414
- # "attrname": "named_trigger",
415
- # "value": {"name": FAT_LADY_PASSWD, "id": self.entry_refs[2].id},
416
- # "will_invoke": True,
417
- # },
388
+ # {
389
+ # "attrname": "named_trigger",
390
+ # "value": {"name": "Open Sesame", "id": self.entry_refs[0].id},
391
+ # "will_invoke": False,
392
+ # },
393
+ # {
394
+ # "attrname": "named_trigger",
395
+ # "value": {"name": "", "id": self.entry_refs[0].id},
396
+ # "will_invoke": False,
397
+ # },
398
+ # {
399
+ # "attrname": "named_trigger",
400
+ # "value": {"name": "Unexpected words", "id": None},
401
+ # "will_invoke": False,
402
+ # },
403
+ # {
404
+ # "attrname": "named_trigger",
405
+ # "value": {"name": FAT_LADY_PASSWD, "id": None},
406
+ # "will_invoke": True,
407
+ # },
408
+ # {
409
+ # "attrname": "named_trigger",
410
+ # "value": {"name": "", "id": self.entry_refs[2].id},
411
+ # "will_invoke": True,
412
+ # },
413
+ # {
414
+ # "attrname": "named_trigger",
415
+ # "value": {"name": FAT_LADY_PASSWD, "id": self.entry_refs[2].id},
416
+ # "will_invoke": True,
417
+ # },
418
418
{"attrname" : "arr_str_trigger" , "value" : ["" ], "will_invoke" : False },
419
419
{
420
420
"attrname" : "arr_str_trigger" ,
@@ -437,19 +437,19 @@ def test_condition_can_be_invoked_for_each_attribute_types(self):
437
437
"value" : self .entry_refs ,
438
438
"will_invoke" : True ,
439
439
},
440
- # {
441
- # "attrname": "arr_named_trigger",
442
- # "value": [{"name": "Open Sesame", "id": self.entry_refs[0].id}],
443
- # "will_invoke": False,
444
- # },
445
- # {
446
- # "attrname": "arr_named_trigger",
447
- # "value": [
448
- # {"name": "Open Sesame", "id": self.entry_refs[0].id},
449
- # {"name": FAT_LADY_PASSWD, "id": self.entry_refs[2].id},
450
- # ],
451
- # "will_invoke": True,
452
- # },
440
+ # {
441
+ # "attrname": "arr_named_trigger",
442
+ # "value": [{"name": "Open Sesame", "id": self.entry_refs[0].id}],
443
+ # "will_invoke": False,
444
+ # },
445
+ # {
446
+ # "attrname": "arr_named_trigger",
447
+ # "value": [
448
+ # {"name": "Open Sesame", "id": self.entry_refs[0].id},
449
+ # {"name": FAT_LADY_PASSWD, "id": self.entry_refs[2].id},
450
+ # ],
451
+ # "will_invoke": True,
452
+ # },
453
453
]
454
454
for test_input_param in test_input_params :
455
455
attr = self .entity .attrs .get (name = test_input_param ["attrname" ])
@@ -483,7 +483,7 @@ def test_register_conditions_with_blank_values(self):
483
483
self .assertFalse (cond .bool_cond )
484
484
485
485
# test cases for specifying empty value
486
- for ( index , cond_info ) in enumerate (self .FULL_CONDITION_CONFIGURATION_PARAMETERS_BUT_EMPTY ):
486
+ for index , cond_info in enumerate (self .FULL_CONDITION_CONFIGURATION_PARAMETERS_BUT_EMPTY ):
487
487
target_attr = self .entity .attrs .get (id = cond_info ["attr_id" ])
488
488
actions = TriggerCondition .get_invoked_actions (
489
489
self .entity , [{"id" : target_attr .id , "value" : cond_info ["cond" ]}]
@@ -502,7 +502,7 @@ def test_register_actions_with_blank_values(self):
502
502
parent_condition = TriggerCondition .register (
503
503
self .entity ,
504
504
[{"attr_id" : cond_attr .id , "cond" : True }],
505
- self .FULL_ACTION_CONFIGURATION_PARAMETERS_BUT_EMPTY
505
+ self .FULL_ACTION_CONFIGURATION_PARAMETERS_BUT_EMPTY ,
506
506
)
507
507
508
508
for value in TriggerActionValue .objects .filter (action__condition = parent_condition ):
@@ -511,14 +511,18 @@ def test_register_actions_with_blank_values(self):
511
511
self .assertFalse (value .bool_cond )
512
512
513
513
# create an Entry with valid attribute value to cehck action processing
514
- target_entry = self .add_entry (self .user , "test entry" , self .entity , values = {
515
- "str_action" : "test-value" ,
516
- "ref_action" : self .entry_refs [0 ],
517
- "bool_action" : True ,
518
- "arr_str_action" : ["foo" , "bar" , "baz" ],
519
- "arr_ref_action" : self .entry_refs ,
520
- "bool_action" : False ,
521
- })
514
+ target_entry = self .add_entry (
515
+ self .user ,
516
+ "test entry" ,
517
+ self .entity ,
518
+ values = {
519
+ "str_action" : "test-value" ,
520
+ "ref_action" : self .entry_refs [0 ],
521
+ "arr_str_action" : ["foo" , "bar" , "baz" ],
522
+ "arr_ref_action" : self .entry_refs ,
523
+ "bool_action" : True ,
524
+ },
525
+ )
522
526
523
527
# invoke trigger action
524
528
actions = TriggerCondition .get_invoked_actions (
0 commit comments