betty.jinja2.test module¶
Provide Betty’s default Jinja2 tests.
- class betty.jinja2.test.PluginTester[source]¶
Bases:
Generic
[_PluginT
]Provides tests for a specific plugin type.
- class betty.jinja2.test.TestEntity[source]¶
Bases:
IndependentFactory
Test if a value is an entity.
- __init__(entity_type_id_to_type_mapping: PluginIdToTypeMapping[Entity])[source]¶
- betty.jinja2.test.test_end_of_life_event(event: Event) bool [source]¶
Test if an event is an end-of-life event.
- betty.jinja2.test.test_has_file_references(value: Any) bool [source]¶
Test if a value has
betty.ancestry.file_reference.FileReference
entities associated with it.
- betty.jinja2.test.test_has_links(value: Any) bool [source]¶
Test if a value has external links associated with it.
- betty.jinja2.test.test_image_supported_media_type(media_type: MediaType | None) bool [source]¶
Test if a media type is supported by the image API.
- betty.jinja2.test.test_linked_data_dumpable(value: Any) bool [source]¶
Test if a value can be dumped to Linked Data.
- betty.jinja2.test.test_start_of_life_event(event: Event) bool [source]¶
Test if an event is a start-of-life event.
- betty.jinja2.test.test_subject_role(value: Any) bool [source]¶
Test if a presence role is that of Subject.
- betty.jinja2.test.test_user_facing_entity(value: Any) bool [source]¶
Test if a value is an entity of a user-facing type.