Skip to content

Commit

Permalink
fix django 1.9.x branch tests
Browse files Browse the repository at this point in the history
  • Loading branch information
maxtepkeev committed Dec 12, 2015
1 parent 2d78739 commit 2f90e25
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions tests/models/django.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,14 @@
'__spec__': ''
})

# Django >= 1.7 needs this
try:
import django
django.setup()
command = 'migrate'
except AttributeError:
command = 'syncdb'

from django.db import models
from django.core import management
from architect import install
Expand Down Expand Up @@ -80,12 +88,4 @@ class Meta(object):
'Meta': Meta,
}))

# Django >= 1.7 needs this
try:
import django
django.setup()
command = 'migrate'
except AttributeError:
command = 'syncdb'

management.call_command(command, verbosity=0, interactive=False)
management.call_command(command, run_syncdb=True, verbosity=0, interactive=False)

0 comments on commit 2f90e25

Please sign in to comment.