PY-22710: Django 2.0 support initial commit

PyPackage represents django and its version, and PyRequirement represents
django version range.
This commit is contained in:
Ilya.Kazakevich
2017-09-25 18:15:56 +03:00
parent 9ba2341850
commit 5b3d6b6c8d
4 changed files with 10 additions and 10 deletions
+1 -1
View File
@@ -51,7 +51,7 @@ if not settings_file:
settings_file = 'settings'
import django
if django.VERSION[0:2] >= (1, 7):
if django.VERSION >= (1, 7):
if not settings.configured:
settings.configure()
django.setup()
+4 -7
View File
@@ -36,7 +36,7 @@ if is_nosetest(settings):
# Since unittest2 became the standard library's unittest module in Python 2.7,
# and Django 1.7 drops support for older Python versions, this module isn't useful anymore.
# It has been deprecated. Use unittest instead.
if VERSION[1] >= 7:
if VERSION >= (1,7):
import unittest
else:
from django.utils import unittest
@@ -51,7 +51,7 @@ def get_test_suite_runner():
return get_runner(TempSettings)
try:
if VERSION[1] >= 6:
if VERSION >= (1,6):
from django.test.runner import DiscoverRunner as DjangoSuiteRunner
else:
from django.test.simple import DjangoTestSuiteRunner as DjangoSuiteRunner
@@ -251,8 +251,5 @@ def run_tests(test_labels, verbosity=1, interactive=False, extra_tests=[],
}
options.update(kwargs)
TeamcityServiceMessages(sys.stdout).testMatrixEntered()
if VERSION[1] > 1:
return DjangoTeamcityTestRunner(**options).run_tests(test_labels,
extra_tests=extra_tests, **options)
return run_the_old_way(extra_tests, options, test_labels, verbosity)
return DjangoTeamcityTestRunner(**options).run_tests(test_labels,
extra_tests=extra_tests, **options)
@@ -6,6 +6,6 @@ urlpatterns = patterns('',
# url(r'^$', 'my_django_proj_17.views.home', name='home'),
# url(r'^blog/', include('blog.urls')),
url(r'^admin/', include(admin.site.urls)),
url(r'^admin/', admin.site.urls),
url(r'^my_app/', include('my_app.urls')),
)
@@ -212,8 +212,11 @@ public class PyRequirement {
this(name, Collections.emptyList());
}
public PyRequirement(@NotNull String name, @NotNull PyRequirementRelation relation, @NotNull String version) {
this(name, Collections.singletonList(calculateVersionSpec(version, relation)));
}
public PyRequirement(@NotNull String name, @NotNull String version) {
this(name, Collections.singletonList(calculateVersionSpec(version, PyRequirementRelation.EQ)));
this(name, PyRequirementRelation.EQ, version);
}
public PyRequirement(@NotNull String name, @NotNull String version, @NotNull List<String> installOptions) {