mirror of
https://github.com/getpelican/pelican.git
synced 2025-10-15 20:28:56 +02:00
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:
parent
000210d875
commit
644fd4ed5f
4 changed files with 15 additions and 9 deletions
|
|
@ -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."""
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue