1
0
Fork 0
forked from github/pelican

settings: add another consistency test for SLUG_SUBSTITUTIONS.

This commit is contained in:
Vladimír Vondruš 2018-11-11 00:17:00 +01:00
commit 4c3b6ac383

View file

@ -285,3 +285,14 @@ class TestSettingsConfiguration(unittest.TestCase):
self.assertEqual(settings['AUTHOR_REGEX_SUBSTITUTIONS'],
[(r'Alexander\ Todorov', 'atodorov')] +
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)