Commit 387d94c1 authored by Samuel GAIST's avatar Samuel GAIST

[test] Make beat/beat.web> setup compatible with Django 3

parent d3680a4c
Pipeline #42516 passed with stage
in 9 minutes and 15 seconds
...@@ -58,6 +58,8 @@ if platform: ...@@ -58,6 +58,8 @@ if platform:
if platform.startswith("django://"): if platform.startswith("django://"):
# sets up django infrastructure, preloads test data # sets up django infrastructure, preloads test data
os.environ.setdefault("DJANGO_SETTINGS_MODULE", platform[9:]) os.environ.setdefault("DJANGO_SETTINGS_MODULE", platform[9:])
from distutils.version import LooseVersion
import django import django
django.setup() django.setup()
...@@ -65,7 +67,14 @@ if platform: ...@@ -65,7 +67,14 @@ if platform:
# presets django database for tests # presets django database for tests
from django.core.management import call_command from django.core.management import call_command
call_command("install", "test", interactive=False, verbose=1) if LooseVersion(
pkg_resources.get_distribution("django").version
) >= LooseVersion("3"):
kwargs = dict(verbosity=1)
else:
kwargs = dict(verbose=1)
call_command("install", "test", **kwargs)
disconnected = False disconnected = False
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment