Adding tests for Django1.6 with Python2.7
* Fixed tox * Fixed test_proj --HG-- branch : supportdj16
This commit is contained in:
parent
a4ada180e4
commit
8a213db74b
|
@ -6,12 +6,28 @@ import sys
|
||||||
path = os.path.abspath(os.path.join(os.path.dirname(__file__), '..'))
|
path = os.path.abspath(os.path.join(os.path.dirname(__file__), '..'))
|
||||||
sys.path.insert(0, path)
|
sys.path.insert(0, path)
|
||||||
|
|
||||||
from django.core.management import execute_manager
|
import django
|
||||||
try:
|
|
||||||
import settings # Assumed to be in the same directory.
|
|
||||||
except ImportError:
|
def manage_16ormore():
|
||||||
sys.stderr.write("Error: Can't find the file 'settings.py' in the directory containing %r. It appears you've customized things.\nYou'll have to run django-admin.py, passing it your settings module.\n(If the file settings.py does indeed exist, it's causing an ImportError somehow.)\n" % __file__)
|
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "settings")
|
||||||
sys.exit(1)
|
from django.core.management import execute_from_command_line
|
||||||
|
|
||||||
|
execute_from_command_line(sys.argv)
|
||||||
|
|
||||||
|
|
||||||
|
def manage_15orless():
|
||||||
|
from django.core.management import execute_manager
|
||||||
|
try:
|
||||||
|
import settings # Assumed to be in the same directory.
|
||||||
|
except ImportError:
|
||||||
|
sys.stderr.write("Error: Can't find the file 'settings.py' in the directory containing %r. It appears you've customized things.\nYou'll have to run django-admin.py, passing it your settings module.\n(If the file settings.py does indeed exist, it's causing an ImportError somehow.)\n" % __file__)
|
||||||
|
sys.exit(1)
|
||||||
|
|
||||||
|
execute_manager(settings)
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
execute_manager(settings)
|
if django.VERSION > (1, 6):
|
||||||
|
manage_16ormore()
|
||||||
|
else:
|
||||||
|
manage_15orless()
|
||||||
|
|
|
@ -146,10 +146,11 @@ INSTALLED_APPS = [
|
||||||
|
|
||||||
try:
|
try:
|
||||||
import django_coverage
|
import django_coverage
|
||||||
TEST_RUNNER = 'django_coverage.coverage_runner.run_tests'
|
TEST_RUNNER = 'django_coverage.coverage_runner.CoverageRunner'
|
||||||
COVERAGE_REPORT_HTML_OUTPUT_DIR = os.path.join(PROJECT_PATH, '_coverage')
|
COVERAGE_REPORT_HTML_OUTPUT_DIR = os.path.join(PROJECT_PATH, '_coverage')
|
||||||
except ImportError:
|
except ImportError:
|
||||||
pass
|
TEST_RUNNER = 'django.test.simple.DjangoTestSuiteRunner'
|
||||||
|
|
||||||
|
|
||||||
ADMIN_TOOLS_INDEX_DASHBOARD = 'test_proj.dashboard.CustomIndexDashboard'
|
ADMIN_TOOLS_INDEX_DASHBOARD = 'test_proj.dashboard.CustomIndexDashboard'
|
||||||
ADMIN_TOOLS_MENU = 'test_proj.menu.CustomMenu'
|
ADMIN_TOOLS_MENU = 'test_proj.menu.CustomMenu'
|
||||||
|
|
|
@ -1,4 +1,7 @@
|
||||||
from django.conf.urls.defaults import *
|
try:
|
||||||
|
from django.conf.urls import url, patterns, include
|
||||||
|
except ImportError:
|
||||||
|
from django.conf.urls.defaults import url, patterns, include
|
||||||
from django.conf import settings
|
from django.conf import settings
|
||||||
from django.contrib import admin
|
from django.contrib import admin
|
||||||
|
|
||||||
|
|
8
tox.ini
8
tox.ini
|
@ -1,5 +1,5 @@
|
||||||
[tox]
|
[tox]
|
||||||
envlist = py26-dj13, py27-dj14, py27-dj15
|
envlist = py26-dj13, py27-dj14, py27-dj15, py27-dj16
|
||||||
|
|
||||||
[testenv:py26-dj13]
|
[testenv:py26-dj13]
|
||||||
basepython = python2.6
|
basepython = python2.6
|
||||||
|
@ -19,6 +19,12 @@ deps =
|
||||||
south
|
south
|
||||||
django==1.5
|
django==1.5
|
||||||
|
|
||||||
|
[testenv:py27-dj16]
|
||||||
|
basepython = python2.7
|
||||||
|
deps =
|
||||||
|
south
|
||||||
|
django==1.6
|
||||||
|
|
||||||
[testenv]
|
[testenv]
|
||||||
commands =
|
commands =
|
||||||
python -V
|
python -V
|
||||||
|
|
Loading…
Reference in New Issue