Skip to content

Commit

Permalink
runtests updated for Django 1.10.
Browse files Browse the repository at this point in the history
  • Loading branch information
idlesign committed Aug 28, 2016
1 parent 548ee8b commit 5765c5f
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 2 deletions.
19 changes: 18 additions & 1 deletion etc/runtests.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,30 @@ def main():
sys.path.insert(0, os.path.join(current_dir, '..'))

if not settings.configured:
settings.configure(
configure_kwargs = dict(
INSTALLED_APPS=('django.contrib.auth', 'django.contrib.contenttypes', 'django.contrib.sites', app_name),
SITE_ID=1,
DATABASES={'default': {'ENGINE': 'django.db.backends.sqlite3'}},
MIDDLEWARE_CLASSES=global_settings.MIDDLEWARE_CLASSES, # Prevents Django 1.7 warning.
)

try:
configure_kwargs['TEMPLATE_CONTEXT_PROCESSORS'] = tuple(global_settings.TEMPLATE_CONTEXT_PROCESSORS) + (
'django.core.context_processors.request',
)

except AttributeError:

# Django 1.8+
configure_kwargs['TEMPLATES'] = [
{
'BACKEND': 'django.template.backends.django.DjangoTemplates',
'APP_DIRS': True,
},
]

settings.configure(**configure_kwargs)

try: # Django 1.7 +
from django import setup
setup()
Expand Down
1 change: 0 additions & 1 deletion etc/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -387,4 +387,3 @@ def test_import_project_modules(self):

self.assertTrue(len(m) == 1)
self.assertTrue(hasattr(m[0], 'get_site_url'))

0 comments on commit 5765c5f

Please sign in to comment.