diff --git a/python/helpers/pycharm/django_test_manage.py b/python/helpers/pycharm/django_test_manage.py index 528109c12a3c..707310d8a126 100644 --- a/python/helpers/pycharm/django_test_manage.py +++ b/python/helpers/pycharm/django_test_manage.py @@ -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() diff --git a/python/helpers/pycharm/django_test_runner.py b/python/helpers/pycharm/django_test_runner.py index 092d93d75b1e..2920ee9374bb 100644 --- a/python/helpers/pycharm/django_test_runner.py +++ b/python/helpers/pycharm/django_test_runner.py @@ -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) \ No newline at end of file + return DjangoTeamcityTestRunner(**options).run_tests(test_labels, + extra_tests=extra_tests, **options) \ No newline at end of file diff --git a/python/helpers/pydev/tests_pydevd_python/my_django_proj_17/my_django_proj_17/urls.py b/python/helpers/pydev/tests_pydevd_python/my_django_proj_17/my_django_proj_17/urls.py index fc5c5877fb88..2ddd99d4d548 100644 --- a/python/helpers/pydev/tests_pydevd_python/my_django_proj_17/my_django_proj_17/urls.py +++ b/python/helpers/pydev/tests_pydevd_python/my_django_proj_17/my_django_proj_17/urls.py @@ -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')), ) diff --git a/python/openapi/src/com/jetbrains/python/packaging/PyRequirement.java b/python/openapi/src/com/jetbrains/python/packaging/PyRequirement.java index d5fe8108508a..203a68cbc36f 100644 --- a/python/openapi/src/com/jetbrains/python/packaging/PyRequirement.java +++ b/python/openapi/src/com/jetbrains/python/packaging/PyRequirement.java @@ -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 installOptions) {