Add test coverage for 'today_fmt' reference substitution (#10980)

This commit is contained in:
James Addison 2022-12-29 14:19:43 +00:00 committed by GitHub
parent da25145d08
commit 041e5f8268
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 11 additions and 0 deletions

View File

@ -45,3 +45,4 @@ D-5. Link to `Translation Tips`_ and `Next Section`_ section.
Next Section
-------------
Last updated |today|.

View File

@ -1383,3 +1383,13 @@ def test_customize_system_message(make_app, app_params, sphinx_test_tempdir):
assert 'QUICK SEARCH' in content
finally:
locale.translators.clear()
@pytest.mark.sphinx('html', testroot='intl', confoverrides={'today_fmt': '%Y-%m-%d'})
def test_customize_today_date_format(app, monkeypatch):
with monkeypatch.context() as m:
m.setenv('SOURCE_DATE_EPOCH', '1439131307')
app.build()
content = (app.outdir / 'refs.html').read_text(encoding='utf8')
assert '2015-08-09' in content