def test_environment_datetime_format(environment) -> None:
    """Verify datetime format can be parsed from environment."""
    environment.datetime_format = '%a, %d %b %Y %H:%M:%S'

    template = environment.from_string("{% now 'utc' %}")

    assert template.render() == "Wed, 09 Dec 2015 23:33:01"
Verify datetime format can be parsed from environment.
tests/test_time_extension.py