Skip to content

Commit

Permalink
Fixes Django 1.7 tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
BertrandBordage committed Dec 7, 2014
1 parent 780c6cb commit 78332a7
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 0 deletions.
5 changes: 5 additions & 0 deletions benchmark.py
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#!/usr/bin/env python
# coding: utf-8

from __future__ import unicode_literals, print_function
Expand All @@ -7,6 +8,7 @@

os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'settings')

import django
from django.conf import settings
from django.contrib.auth.models import User, Group
from django.core.cache import get_cache
Expand Down Expand Up @@ -176,6 +178,9 @@ def create_data(using):


if __name__ == '__main__':
if django.VERSION[:2] >= (1, 7):
django.setup()

old_db_names = {}
for alias in connections:
conn = connections[alias]
Expand Down
3 changes: 3 additions & 0 deletions runtests.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,13 @@
from __future__ import unicode_literals
import os
import sys
import django


if __name__ == '__main__':
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'settings')
if django.VERSION[:2] >= (1, 7):
django.setup()
from django.test.runner import DiscoverRunner
test_runner = DiscoverRunner()
failures = test_runner.run_tests(['cachalot.tests'])
Expand Down
1 change: 1 addition & 0 deletions settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,5 +60,6 @@
INSTALLED_APPS.append('south')


MIDDLEWARE_CLASSES = ()
PASSWORD_HASHERS = ('django.contrib.auth.hashers.MD5PasswordHasher',)
SECRET_KEY = 'it’s not important but we have to set it'

0 comments on commit 78332a7

Please sign in to comment.