mirror of
https://github.com/getpelican/pelican.git
synced 2025-10-15 20:28:56 +02:00
Merge pull request #2004 from Scheirle/unittest_py2
Fixes unit test test_period_in_timeperiod_archive (TestArticlesGenerator)
This commit is contained in:
commit
937f366b80
1 changed files with 3 additions and 0 deletions
|
|
@ -297,6 +297,8 @@ class TestArticlesGenerator(unittest.TestCase):
|
||||||
Test that the context of a generated period_archive is passed
|
Test that the context of a generated period_archive is passed
|
||||||
'period' : a tuple of year, month, day according to the time period
|
'period' : a tuple of year, month, day according to the time period
|
||||||
"""
|
"""
|
||||||
|
old_locale = locale.setlocale(locale.LC_ALL)
|
||||||
|
locale.setlocale(locale.LC_ALL, str('C'))
|
||||||
settings = get_settings(filenames={})
|
settings = get_settings(filenames={})
|
||||||
|
|
||||||
settings['YEAR_ARCHIVE_SAVE_AS'] = 'posts/{date:%Y}/index.html'
|
settings['YEAR_ARCHIVE_SAVE_AS'] = 'posts/{date:%Y}/index.html'
|
||||||
|
|
@ -357,6 +359,7 @@ class TestArticlesGenerator(unittest.TestCase):
|
||||||
generator.get_template("period_archives"),
|
generator.get_template("period_archives"),
|
||||||
settings,
|
settings,
|
||||||
blog=True, dates=dates)
|
blog=True, dates=dates)
|
||||||
|
locale.setlocale(locale.LC_ALL, old_locale)
|
||||||
|
|
||||||
def test_nonexistent_template(self):
|
def test_nonexistent_template(self):
|
||||||
"""Attempt to load a non-existent template"""
|
"""Attempt to load a non-existent template"""
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue