Skip to content

Commit 96e6300

Browse files
committed
Add test case : theme with no locale set
1 parent 606be8f commit 96e6300

File tree

2 files changed

+24
-0
lines changed

2 files changed

+24
-0
lines changed
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
site_name: test gitrevisiondatelocalized_plugin
2+
use_directory_urls: true
3+
4+
theme:
5+
name: 'material'
6+
7+
plugins:
8+
- search
9+
- git-revision-date-localized

tests/test_basic.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -289,6 +289,21 @@ def test_material_theme(tmp_path):
289289
assert re.search(r"Letztes Update\:\s[\w].+", contents)
290290

291291

292+
def test_material_theme_no_locale(tmp_path):
293+
"""
294+
When using mkdocs-material theme, test correct working
295+
"""
296+
# theme set to 'material' with 'language' set to 'de'
297+
testproject_path = validate_mkdocs_file(
298+
tmp_path, "tests/basic_setup/mkdocs_theme_no_locale.yml"
299+
)
300+
301+
# In mkdocs-material, a 'last update' should appear
302+
# in German because locale is set to 'de'
303+
index_file = testproject_path / "site/index.html"
304+
contents = index_file.read_text(encoding="utf8")
305+
assert re.search(r"Last update\:\s[\w].+", contents)
306+
292307
def test_type_timeago(tmp_path):
293308
# type: 'timeago'
294309
testproject_path = validate_mkdocs_file(

0 commit comments

Comments
 (0)