betty.jinja2.test module - Betty documentation

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.

class betty.jinja2.test.TestEntity

  Bases: `IndependentFactory`

  Test if a value is an entity.

  __init__(entity_type_id_to_type_mapping: PluginIdToTypeMapping[Entity])
  async classmethod new() → Self

    Create a new instance.

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_has_file_references(value: Any) → bool

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

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.

async betty.jinja2.test.tests() → Mapping[str, Callable[..., bool]]

  Define the available tests.

  This is internal. It MAY be used anywhere in Betty’s source code, but MUST NOT be used by third-party code.