Deep copy _DEFAULT_SETTINGS instead of linking.

This caused the defaults to be overwritten and edge case bugs with tests.
The test for empty setting needed to be updated to reflect that the method
for setting up the local settings sets extra settings.
This commit is contained in:
tBunnyMan 2012-08-29 12:17:59 -07:00
commit 644fd4ed5f
4 changed files with 15 additions and 9 deletions

View file

@ -1,6 +1,7 @@
import copy
from os.path import dirname, abspath, join
from pelican.settings import read_settings, configure_settings, _DEFAULT_CONFIG
from pelican.settings import read_settings, configure_settings, _DEFAULT_CONFIG, DEFAULT_THEME
from .support import unittest
@ -31,7 +32,10 @@ class TestSettingsConfiguration(unittest.TestCase):
def test_read_empty_settings(self):
"""providing no file should return the default values."""
settings = read_settings(None)
self.assertDictEqual(settings, _DEFAULT_CONFIG)
expected = copy.deepcopy(_DEFAULT_CONFIG)
expected["FEED_DOMAIN"] = '' #This is added by configure settings
self.maxDiff = None
self.assertDictEqual(settings, expected)
def test_configure_settings(self):
"""Manipulations to settings should be applied correctly."""