This repository has been archived by the owner on Aug 17, 2023. It is now read-only.
forked from jessemiller/HamlPy
-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Improve tests that require Django instance by moving settings into ac…
…tual settings module
- Loading branch information
1 parent
87ffdcf
commit cdb442d
Showing
4 changed files
with
56 additions
and
40 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
from __future__ import unicode_literals | ||
|
||
import django | ||
import os | ||
|
||
|
||
os.environ['DJANGO_SETTINGS_MODULE'] = 'hamlpy.test.settings' | ||
django.setup() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
from __future__ import unicode_literals | ||
|
||
import django | ||
|
||
from distutils.version import StrictVersion | ||
|
||
DEBUG = True | ||
|
||
DATABASES = {} | ||
|
||
INSTALLED_APPS = ('hamlpy',) | ||
|
||
TEMPLATE_DIR = 'hamlpy/test/templates' | ||
TEMPLATE_LOADERS = [ | ||
'hamlpy.template.loaders.HamlPyFilesystemLoader', | ||
'hamlpy.template.loaders.HamlPyAppDirectoriesLoader', | ||
'django.template.loaders.filesystem.Loader', | ||
'django.template.loaders.app_directories.Loader' | ||
] | ||
|
||
if StrictVersion(django.get_version()) >= StrictVersion('1.8'): | ||
TEMPLATES = [ | ||
{ | ||
'BACKEND': 'django.template.backends.django.DjangoTemplates', | ||
'DIRS': [TEMPLATE_DIR], | ||
'OPTIONS': {'loaders': TEMPLATE_LOADERS, 'debug': True} | ||
} | ||
] | ||
else: | ||
TEMPLATE_DIRS = [TEMPLATE_DIR] | ||
TEMPLATE_LOADERS = TEMPLATE_LOADERS | ||
TEMPLATE_DEBUG = True | ||
|
||
SECRET_KEY = 'tots top secret' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters