Commits

David Jean Louis  committed a0abfff Merge

Merged in hirokiky/django-admin-tools/supportdj16 (pull request #27) and also added python3.3/django1.6 environment

  • Participants
  • Parent commits 77cfa30, aaf4084

Comments (0)

Files changed (4)

File test_proj/manage.py

 path = os.path.abspath(os.path.join(os.path.dirname(__file__), '..'))
 sys.path.insert(0, path)
 
-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)
+import django
+
+
+def manage_16ormore():
+    os.environ.setdefault("DJANGO_SETTINGS_MODULE", "settings")
+    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__":
-    execute_manager(settings)
+    if django.VERSION > (1, 6):
+        manage_16ormore()
+    else:
+        manage_15orless()

File test_proj/settings.py

 
 try:
     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')
 except ImportError:
-    pass
+    TEST_RUNNER = 'django.test.simple.DjangoTestSuiteRunner'
+
 
 ADMIN_TOOLS_INDEX_DASHBOARD = 'test_proj.dashboard.CustomIndexDashboard'
 ADMIN_TOOLS_MENU = 'test_proj.menu.CustomMenu'

File test_proj/urls.py

File contents unchanged.
 [tox]
-envlist = py26-dj13, py27-dj14, py27-dj15
+envlist = py26-dj13, py27-dj14, py27-dj15, py27-dj16, py33-dj16
 
 [testenv:py26-dj13]
 basepython = python2.6
   south
   django==1.5
 
+[testenv:py27-dj16]
+basepython = python2.7
+deps =
+  south
+  django==1.6
+
+[testenv:py33-dj16]
+basepython = python3.3
+deps =
+  south
+  django==1.6
+
 [testenv]
 commands =
   python -V