mirror of
https://github.com/getpelican/pelican.git
synced 2026-05-27 15:56:13 +02:00
added theme unittest
This commit is contained in:
parent
954d6e496b
commit
fc397b0419
1 changed files with 28 additions and 0 deletions
28
pelican/tests/test_importedsettings.py
Normal file
28
pelican/tests/test_importedsettings.py
Normal file
|
|
@ -0,0 +1,28 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
from __future__ import unicode_literals, print_function
|
||||
import os
|
||||
import unittest
|
||||
import sys
|
||||
import locale
|
||||
|
||||
from pelican.utils.importlib import import_module
|
||||
from pelican.settings import read_settings
|
||||
from pelican.settings.base import _DEFAULT_CONFIG
|
||||
|
||||
# runtest with:
|
||||
# cd ~/pelican/pelican/tests && python -m unittest discover . 'test_importeds*' && cd -
|
||||
class TestImportLib(unittest.TestCase):
|
||||
def setUp(self):
|
||||
path = os.path.join(os.path.dirname(__file__), '../..')
|
||||
sys.path.append(os.path.abspath(path))
|
||||
|
||||
|
||||
def test_importedsettings(self):
|
||||
self.settings = read_settings(path=None, override={
|
||||
'LOCALE': locale.normalize('en_US'),
|
||||
'THEME': '/tmp/theme'# You might want tho change this...
|
||||
})
|
||||
from pelican.settings import conf
|
||||
for key in _DEFAULT_CONFIG.keys():
|
||||
assert hasattr(conf, key)
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue