Compare commits

..

2 Commits

Author SHA1 Message Date
Frédéric Péters f1aba77545 blocks: add support for post conditions (#71778)
gitea/wcs/pipeline/head This commit looks good Details
2024-03-12 14:15:49 +01:00
Frédéric Péters 8ca423bb99 blocks: add/manage post conditions attribute (#71778) 2024-03-12 14:15:49 +01:00
1 changed files with 6 additions and 0 deletions

View File

@ -95,6 +95,9 @@ def test_i18n_page(pub):
block = BlockDef(name='test')
# check strings will be stripped
block.fields = [StringField(id='1', label='text field ')]
block.post_conditions = [
{'condition': {'type': 'django', 'value': 'blah1'}, 'error_message': 'block post condition error'},
]
block.store()
carddef = CardDef()
@ -135,6 +138,9 @@ def test_i18n_page(pub):
# check custom validation message
assert TranslatableMessage.count([Equal('string', 'Custom Error')]) == 1
# check block post condition
assert TranslatableMessage.count([Equal('string', 'block post condition error')]) == 1
# check table
assert resp.pyquery('tr').length == TranslatableMessage.count()