mirror of
https://github.com/getpelican/pelican.git
synced 2025-10-15 20:28:56 +02:00
settings: add another consistency test for SLUG_SUBSTITUTIONS.
This commit is contained in:
parent
d01614495f
commit
4c3b6ac383
1 changed files with 11 additions and 0 deletions
|
|
@ -285,3 +285,14 @@ class TestSettingsConfiguration(unittest.TestCase):
|
||||||
self.assertEqual(settings['AUTHOR_REGEX_SUBSTITUTIONS'],
|
self.assertEqual(settings['AUTHOR_REGEX_SUBSTITUTIONS'],
|
||||||
[(r'Alexander\ Todorov', 'atodorov')] +
|
[(r'Alexander\ Todorov', 'atodorov')] +
|
||||||
default_slug_regex_subs)
|
default_slug_regex_subs)
|
||||||
|
|
||||||
|
def test_deprecated_slug_substitutions_from_file(self):
|
||||||
|
# This is equivalent to reading a settings file that has
|
||||||
|
# SLUG_SUBSTITUTIONS defined but no SLUG_REGEX_SUBSTITUTIONS.
|
||||||
|
settings = read_settings(None, override={
|
||||||
|
'SLUG_SUBSTITUTIONS': [('C++', 'cpp')]
|
||||||
|
})
|
||||||
|
self.assertEqual(settings['SLUG_REGEX_SUBSTITUTIONS'],
|
||||||
|
[(r'C\+\+', 'cpp')] +
|
||||||
|
self.settings['SLUG_REGEX_SUBSTITUTIONS'])
|
||||||
|
self.assertNotIn('SLUG_SUBSTITUTIONS', settings)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue