Hide navigation sidebar
Hide table of contents sidebar
Skip to content
Back to top
View this page
Toggle table of contents sidebar

# betty.jinja2.test module

Provide Betty’s default Jinja2 tests.

betty.jinja2.test.test_date_range(value: Any) → bool

  Test if a value is a date range.

betty.jinja2.test.test_end_of_life_event(event: Event) → bool

  Test if an event is an end-of-life event.

betty.jinja2.test.test_entity(value: Any, entity_type_id: MachineName | None = None) → bool

  Test if a value is an entity.

  Parameters:

    entity_type_id – If given, additionally ensure the value is an entity of this type.

betty.jinja2.test.test_has_file_references(value: Any) → bool

  Test if a value has `betty.model.ancestry.FileReference` entities associated with it.

betty.jinja2.test.test_has_generated_entity_id(value: Any) → bool

  Test if a value is a generated entity ID, or if it is an entity and has a generated entity ID.

betty.jinja2.test.test_has_links(value: Any) → bool

  Test if a value has external links associated with it.

betty.jinja2.test.test_linked_data_dumpable(value: Any) → bool

  Test if a value can be dumped to Linked Data.

betty.jinja2.test.test_start_of_life_event(event: Event) → bool

  Test if an event is a start-of-life event.

betty.jinja2.test.test_subject_role(value: Any) → bool

  Test if a presence role is that of Subject.

betty.jinja2.test.test_user_facing_entity(value: Any) → bool

  Test if a value is an entity of a user-facing type.

betty.jinja2.test.test_witness_role(value: Any) → bool

  Test if a presence role is that of Witness.