mirror of
https://github.com/getpelican/pelican.git
synced 2025-10-15 20:28:56 +02:00
refactoring so that command line options override settings
and Pelican class now accepts a single parameter ``settings``
This commit is contained in:
parent
136e2e46d8
commit
4029f2ec82
4 changed files with 80 additions and 63 deletions
|
|
@ -56,16 +56,19 @@ class TestSettingsConfiguration(unittest.TestCase):
|
|||
def test_configure_settings(self):
|
||||
"""Manipulations to settings should be applied correctly."""
|
||||
|
||||
# SITEURL should not have a trailing slash
|
||||
settings = {'SITEURL': 'http://blog.notmyidea.org/', 'LOCALE': ''}
|
||||
settings = {
|
||||
'SITEURL': 'http://blog.notmyidea.org/',
|
||||
'LOCALE': '',
|
||||
'PATH': '.',
|
||||
'THEME': DEFAULT_THEME,
|
||||
}
|
||||
configure_settings(settings)
|
||||
# SITEURL should not have a trailing slash
|
||||
self.assertEqual(settings['SITEURL'], 'http://blog.notmyidea.org')
|
||||
|
||||
# FEED_DOMAIN, if undefined, should default to SITEURL
|
||||
settings = {'SITEURL': 'http://blog.notmyidea.org', 'LOCALE': ''}
|
||||
configure_settings(settings)
|
||||
self.assertEqual(settings['FEED_DOMAIN'], 'http://blog.notmyidea.org')
|
||||
|
||||
settings = {'FEED_DOMAIN': 'http://feeds.example.com', 'LOCALE': ''}
|
||||
settings['FEED_DOMAIN'] = 'http://feeds.example.com'
|
||||
configure_settings(settings)
|
||||
self.assertEqual(settings['FEED_DOMAIN'], 'http://feeds.example.com')
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue