Fixed python 3.2 compat.
This commit is contained in:
parent
89bf7a4525
commit
ffa8a9ab24
|
@ -25,12 +25,12 @@ def check_compatibility():
|
||||||
messages = []
|
messages = []
|
||||||
|
|
||||||
for check_module in COMPAT_CHECKS:
|
for check_module in COMPAT_CHECKS:
|
||||||
check = getattr(check_module, u'run_checks', None)
|
check = getattr(check_module, 'run_checks', None)
|
||||||
|
|
||||||
if check is None:
|
if check is None:
|
||||||
warnings.warn(
|
warnings.warn(
|
||||||
u"The '%s' module lacks a " % check_module.__name__ +
|
"The '%s' module lacks a " % check_module.__name__ +
|
||||||
u"'run_checks' method, which is needed to verify compatibility."
|
"'run_checks' method, which is needed to verify compatibility."
|
||||||
)
|
)
|
||||||
continue
|
continue
|
||||||
|
|
||||||
|
|
|
@ -10,19 +10,19 @@ def check_test_runner():
|
||||||
doing & avoid generating a message.
|
doing & avoid generating a message.
|
||||||
"""
|
"""
|
||||||
from django.conf import settings
|
from django.conf import settings
|
||||||
new_default = u'django.test.runner.DiscoverRunner'
|
new_default = 'django.test.runner.DiscoverRunner'
|
||||||
test_runner_setting = getattr(settings, u'TEST_RUNNER', new_default)
|
test_runner_setting = getattr(settings, 'TEST_RUNNER', new_default)
|
||||||
|
|
||||||
if test_runner_setting == new_default:
|
if test_runner_setting == new_default:
|
||||||
message = [
|
message = [
|
||||||
u"You have not explicitly set 'TEST_RUNNER'. In Django 1.6,",
|
"You have not explicitly set 'TEST_RUNNER'. In Django 1.6,",
|
||||||
u"there is a new test runner ('%s')" % new_default,
|
"there is a new test runner ('%s')" % new_default,
|
||||||
u"by default. You should ensure your tests are still all",
|
"by default. You should ensure your tests are still all",
|
||||||
u"running & behaving as expected. See",
|
"running & behaving as expected. See",
|
||||||
u"https://docs.djangoproject.com/en/dev/releases/1.6/#discovery-of-tests-in-any-test-module",
|
"https://docs.djangoproject.com/en/dev/releases/1.6/#discovery-of-tests-in-any-test-module",
|
||||||
u"for more information.",
|
"for more information.",
|
||||||
]
|
]
|
||||||
return u' '.join(message)
|
return ' '.join(message)
|
||||||
|
|
||||||
|
|
||||||
def run_checks():
|
def run_checks():
|
||||||
|
|
|
@ -6,8 +6,8 @@ from django.core.management.base import NoArgsCommand
|
||||||
|
|
||||||
|
|
||||||
class Command(NoArgsCommand):
|
class Command(NoArgsCommand):
|
||||||
help = u"Checks your configuration's compatibility with this version " + \
|
help = "Checks your configuration's compatibility with this version " + \
|
||||||
u"of Django."
|
"of Django."
|
||||||
|
|
||||||
def handle_noargs(self, **options):
|
def handle_noargs(self, **options):
|
||||||
for message in check_compatibility():
|
for message in check_compatibility():
|
||||||
|
|
Loading…
Reference in New Issue