@@ -197,16 +197,25 @@ def test_reference_missing_question(
197
197
("sub_question" , "info.parent.form == 'top_form'" , True , "subform" ),
198
198
("sub_question" , "info.parent.formMeta.level == 0" , True , "subform" ),
199
199
("sub_question" , "info.parent.formMeta['is-top-form']" , True , "subform" ),
200
+ ("sub_question" , "info.mainCaseForm == 'main-case-form'" , True , "subform" ),
200
201
("column" , "info.parent.form == 'top_form'" , True , "table" ),
201
202
("column" , "info.parent.formMeta.level == 0" , True , "table" ),
202
203
("column" , "info.parent.formMeta['is-top-form']" , True , "table" ),
203
204
("column" , "info.root.form == 'top_form'" , True , "table" ),
204
205
("column" , "info.root.formMeta.level == 0" , True , "table" ),
205
206
("column" , "info.root.formMeta['is-top-form']" , True , "table" ),
207
+ ("column" , "info.mainCaseForm == 'main-case-form'" , True , "table" ),
206
208
],
207
209
)
208
210
def test_new_jexl_expressions (
209
- question , expr , expectation , features , info , form_and_document
211
+ question ,
212
+ expr ,
213
+ expectation ,
214
+ features ,
215
+ info ,
216
+ form_and_document ,
217
+ case_factory ,
218
+ work_item_factory ,
210
219
):
211
220
"""Evaluate a JEXL expression in the context of a full document.
212
221
@@ -231,6 +240,9 @@ def test_new_jexl_expressions(
231
240
use_table = use_table , use_subform = use_subform
232
241
)
233
242
243
+ main_case = case_factory (document__form__slug = "main-case-form" )
244
+ work_item_factory (case = main_case , document = document )
245
+
234
246
# expression test method: we delete an answer and set it's is_hidden
235
247
# to an expression to be tested. If the expression evaluates to True,
236
248
# we won't have a ValidationError.
0 commit comments