mirror of
https://github.com/Hopiu/django-cachalot.git
synced 2026-03-16 21:30:23 +00:00
Fixes Django 1.7 tests.
This commit is contained in:
parent
780c6cbdc0
commit
78332a7ef0
3 changed files with 9 additions and 0 deletions
5
benchmark.py
Normal file → Executable file
5
benchmark.py
Normal file → Executable file
|
|
@ -1,3 +1,4 @@
|
|||
#!/usr/bin/env python
|
||||
# coding: utf-8
|
||||
|
||||
from __future__ import unicode_literals, print_function
|
||||
|
|
@ -7,6 +8,7 @@ from time import time
|
|||
|
||||
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
|
||||
|
|
@ -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]
|
||||
|
|
|
|||
|
|
@ -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'])
|
||||
|
|
|
|||
|
|
@ -60,5 +60,6 @@ if django.VERSION < (1, 7):
|
|||
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'
|
||||
|
|
|
|||
Loading…
Reference in a new issue