diff --git a/pelican/tests/test_settings.py b/pelican/tests/test_settings.py index bb05e2ae..a92cf09c 100644 --- a/pelican/tests/test_settings.py +++ b/pelican/tests/test_settings.py @@ -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)