Skip to content

Commit 041e5f8

Browse files
authored
Add test coverage for 'today_fmt' reference substitution (#10980)
1 parent da25145 commit 041e5f8

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

tests/roots/test-intl/refs.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,3 +45,4 @@ D-5. Link to `Translation Tips`_ and `Next Section`_ section.
4545

4646
Next Section
4747
-------------
48+
Last updated |today|.

tests/test_intl.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1383,3 +1383,13 @@ def test_customize_system_message(make_app, app_params, sphinx_test_tempdir):
13831383
assert 'QUICK SEARCH' in content
13841384
finally:
13851385
locale.translators.clear()
1386+
1387+
1388+
@pytest.mark.sphinx('html', testroot='intl', confoverrides={'today_fmt': '%Y-%m-%d'})
1389+
def test_customize_today_date_format(app, monkeypatch):
1390+
with monkeypatch.context() as m:
1391+
m.setenv('SOURCE_DATE_EPOCH', '1439131307')
1392+
app.build()
1393+
content = (app.outdir / 'refs.html').read_text(encoding='utf8')
1394+
1395+
assert '2015-08-09' in content

0 commit comments

Comments
 (0)