2635 |
2635 |
'type': 'formula',
|
2636 |
2636 |
'value': repr(
|
2637 |
2637 |
[
|
2638 |
|
{'id': '1', 'text': 'un', 'more': 'foo', 'url': 'xxx'},
|
2639 |
|
{'id': '2', 'text': 'deux', 'more': 'bar', 'url': 'yyy'},
|
|
2638 |
{'id': '1', 'text': 'un', 'more': 'foo', 'url': 'xxx', 'invalid:key': 'xxx'},
|
|
2639 |
{'id': '2', 'text': 'deux', 'more': 'bar', 'url': 'yyy', 'invalid:key': 'yyy'},
|
2640 |
2640 |
]
|
2641 |
2641 |
),
|
2642 |
2642 |
}
|
... | ... | |
2680 |
2680 |
tmpl = Template('{% for x in form_var_plop_structured %}{{x.more}}{% endfor %}')
|
2681 |
2681 |
assert tmpl.render(context) == 'foobar'
|
2682 |
2682 |
|
2683 |
|
assert 'form_var_plop_0_url' in pub.substitutions.get_context_variables(mode='lazy').get_flat_keys()
|
2684 |
|
assert 'form_var_plop_1_more' in pub.substitutions.get_context_variables(mode='lazy').get_flat_keys()
|
2685 |
|
assert 'form_var_plop_structured' in pub.substitutions.get_context_variables(mode='lazy').get_flat_keys()
|
2686 |
|
assert 'form_var_plop_raw' in pub.substitutions.get_context_variables(mode='lazy').get_flat_keys()
|
|
2683 |
flat_keys = pub.substitutions.get_context_variables(mode='lazy').get_flat_keys()
|
|
2684 |
assert 'form_var_plop_0_url' in flat_keys
|
|
2685 |
assert 'form_var_plop_1_more' in flat_keys
|
|
2686 |
assert 'form_var_plop_structured' in flat_keys
|
|
2687 |
assert 'form_var_plop_raw' in flat_keys
|
|
2688 |
assert 'form_var_plop_0_invalid:key' not in flat_keys
|
2687 |
2689 |
|
2688 |
|
assert 'form_var_plop2' in pub.substitutions.get_context_variables(mode='lazy').get_flat_keys()
|
2689 |
|
assert 'form_var_plop2_raw' in pub.substitutions.get_context_variables(mode='lazy').get_flat_keys()
|
2690 |
|
assert 'form_var_plop2_structured' in pub.substitutions.get_context_variables(mode='lazy').get_flat_keys()
|
|
2690 |
assert 'form_var_plop2' in flat_keys
|
|
2691 |
assert 'form_var_plop2_raw' in flat_keys
|
|
2692 |
assert 'form_var_plop2_structured' in flat_keys
|
2691 |
2693 |
|
2692 |
2694 |
|
2693 |
2695 |
def test_formdata_user_field(pub, variable_test_data):
|