betty.jinja2.test module
Provide Betty’s default Jinja2 tests.
-
betty.jinja2.test.test_date_range(value)[source]
Test if a value is a date range.
- Parameters:
- value
-
- Return type:
bool
-
betty.jinja2.test.test_end_of_life_event(event)[source]
Test if an event is an end-of-life event.
- Parameters:
- event
-
- Return type:
bool
-
betty.jinja2.test.test_entity(value, entity_type_name=None)[source]
Test if a value is an entity.
- Parameters:
- entity_type_name=None
If given, additionally ensure the value is an entity of this type.
- value
-
- Return type:
bool
-
betty.jinja2.test.test_has_files(value)[source]
Test if a value has file entities associated with it.
- Parameters:
- value
-
- Return type:
bool
-
betty.jinja2.test.test_has_generated_entity_id(value)[source]
Test if a value is a generated entity ID, or if it is an entity and has a generated entity ID.
- Parameters:
- value
-
- Return type:
bool
-
betty.jinja2.test.test_has_links(value)[source]
Test if a value has external links associated with it.
- Parameters:
- value
-
- Return type:
bool
-
betty.jinja2.test.test_linked_data_dumpable(value)[source]
Test if a value can be dumped to Linked Data.
- Parameters:
- value
-
- Return type:
bool
-
betty.jinja2.test.test_start_of_life_event(event)[source]
Test if an event is a start-of-life event.
- Parameters:
- event
-
- Return type:
bool
-
betty.jinja2.test.test_subject_role(value)[source]
Test if a presence role is that of Subject.
- Parameters:
- value
-
- Return type:
bool
-
betty.jinja2.test.test_user_facing_entity(value)[source]
Test if a value is an entity of a user-facing type.
- Parameters:
- value
-
- Return type:
bool
-
betty.jinja2.test.test_witness_role(value)[source]
Test if a presence role is that of Witness.
- Parameters:
- value
-
- Return type:
bool