Skip to content

Commit

Permalink
Add test coverage for 'today_fmt' reference substitution (#10980)
Browse files Browse the repository at this point in the history
  • Loading branch information
jayaddison committed Dec 29, 2022
1 parent da25145 commit 041e5f8
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
1 change: 1 addition & 0 deletions tests/roots/test-intl/refs.txt
Expand Up @@ -45,3 +45,4 @@ D-5. Link to `Translation Tips`_ and `Next Section`_ section.

Next Section
-------------
Last updated |today|.
10 changes: 10 additions & 0 deletions tests/test_intl.py
Expand Up @@ -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

0 comments on commit 041e5f8

Please sign in to comment.