Assert all touched
Call assert_all_touched()
on a document, section or fieldset to ensure that no
data has been left untouched by your application.
document = enolib.parse('importan_option: no_delete') # Note the mis-typed key
important_option = document.field('important_option').optional_string_value()
document.assert_all_touched()
When you run this code an error will be raised in the last line:
This element was not expected, make sure it is at the right place in the document and that its key is not mis-typed.
Line | Content
> 1 | importan_option: no_delete
Next page: Manual touching