summaryrefslogtreecommitdiffstats
path: root/testsuite
diff options
context:
space:
mode:
authorAlexander Sulfrian <alexander.sulfrian@fu-berlin.de>2016-08-17 15:40:55 +0200
committerAlexander Sulfrian <alexander.sulfrian@fu-berlin.de>2016-08-17 21:00:05 +0200
commit1b3cd3a9f4a7961ea15e87da20166f634c503446 (patch)
tree400be6a65ae285a9237cc3eb75debada08f7fe61 /testsuite
parent19fcb30022175ccbe84efd70d1a6808645036dfb (diff)
downloadbcfg2-1b3cd3a9f4a7961ea15e87da20166f634c503446.tar.gz
bcfg2-1b3cd3a9f4a7961ea15e87da20166f634c503446.tar.bz2
bcfg2-1b3cd3a9f4a7961ea15e87da20166f634c503446.zip
testsuite: Drop 'syncdb' for newer versions of django
With django>=1.7 'syncdb' is not needed anymore, all stuff is handled with 'migrate' now. The django.setup call is not needed there, because the models have to call it before definition.
Diffstat (limited to 'testsuite')
-rw-r--r--testsuite/common.py10
1 files changed, 6 insertions, 4 deletions
diff --git a/testsuite/common.py b/testsuite/common.py
index 396f1887b..47e3bfb14 100644
--- a/testsuite/common.py
+++ b/testsuite/common.py
@@ -219,12 +219,14 @@ class DBModelTestCase(Bcfg2TestCase):
def test_syncdb(self):
""" Create the test database and sync the schema """
if self.models:
- import django.core.management
import django
- if django.VERSION[0] == 1 and django.VERSION[1] >= 7:
- django.setup()
+ import django.core.management
+
+ if django.VERSION[0] == 1 and django.VERSION[1] < 7:
+ django.core.management.call_command('syncdb', interactive=False,
+ verbosity=0)
- django.core.management.call_command("syncdb", interactive=False,
+ django.core.management.call_command('migrate', interactive=False,
verbosity=0)
self.assertTrue(
os.path.exists(