From 0346563939396fb89dec8df31f82eaefaaeb8616 Mon Sep 17 00:00:00 2001 From: Russell Keith-Magee Date: Tue, 25 Jun 2013 09:37:54 +0800 Subject: [PATCH] Fixed #20653 -- Renamed checksetup management command. This is to allow future compatibility with work that is ongoing in the 2013 GSoC. --- .../{compat_checks => checks}/__init__.py | 0 .../core/checks/compatibility}/__init__.py | 0 .../compatibility}/base.py | 2 +- .../compatibility}/django_1_6_0.py | 2 +- .../commands/{checksetup.py => check.py} | 2 +- docs/releases/1.6.txt | 6 ++--- tests/check/__init__.py | 0 tests/{compat_checks => check}/models.py | 0 tests/{compat_checks => check}/tests.py | 22 +++++++++---------- 9 files changed, 17 insertions(+), 17 deletions(-) rename django/core/{compat_checks => checks}/__init__.py (100%) rename {tests/compat_checks => django/core/checks/compatibility}/__init__.py (100%) rename django/core/{compat_checks => checks/compatibility}/base.py (94%) rename django/core/{compat_checks => checks/compatibility}/django_1_6_0.py (94%) rename django/core/management/commands/{checksetup.py => check.py} (83%) create mode 100644 tests/check/__init__.py rename tests/{compat_checks => check}/models.py (100%) rename tests/{compat_checks => check}/tests.py (86%) diff --git a/django/core/compat_checks/__init__.py b/django/core/checks/__init__.py similarity index 100% rename from django/core/compat_checks/__init__.py rename to django/core/checks/__init__.py diff --git a/tests/compat_checks/__init__.py b/django/core/checks/compatibility/__init__.py similarity index 100% rename from tests/compat_checks/__init__.py rename to django/core/checks/compatibility/__init__.py diff --git a/django/core/compat_checks/base.py b/django/core/checks/compatibility/base.py similarity index 94% rename from django/core/compat_checks/base.py rename to django/core/checks/compatibility/base.py index e54b50f2877..7fe52d2af96 100644 --- a/django/core/compat_checks/base.py +++ b/django/core/checks/compatibility/base.py @@ -1,7 +1,7 @@ from __future__ import unicode_literals import warnings -from django.core.compat_checks import django_1_6_0 +from django.core.checks.compatibility import django_1_6_0 COMPAT_CHECKS = [ diff --git a/django/core/compat_checks/django_1_6_0.py b/django/core/checks/compatibility/django_1_6_0.py similarity index 94% rename from django/core/compat_checks/django_1_6_0.py rename to django/core/checks/compatibility/django_1_6_0.py index bb0dabedac9..1998c5ba77b 100644 --- a/django/core/compat_checks/django_1_6_0.py +++ b/django/core/checks/compatibility/django_1_6_0.py @@ -27,7 +27,7 @@ def check_test_runner(): def run_checks(): """ - Required by the ``checksetup`` management command, this returns a list of + Required by the ``check`` management command, this returns a list of messages from all the relevant check functions for this version of Django. """ checks = [ diff --git a/django/core/management/commands/checksetup.py b/django/core/management/commands/check.py similarity index 83% rename from django/core/management/commands/checksetup.py rename to django/core/management/commands/check.py index d37e826757f..05f48c82bc4 100644 --- a/django/core/management/commands/checksetup.py +++ b/django/core/management/commands/check.py @@ -1,7 +1,7 @@ from __future__ import unicode_literals import warnings -from django.core.compat_checks.base import check_compatibility +from django.core.checks.compatibility.base import check_compatibility from django.core.management.base import NoArgsCommand diff --git a/docs/releases/1.6.txt b/docs/releases/1.6.txt index 95bfedc74e0..086c10c389c 100644 --- a/docs/releases/1.6.txt +++ b/docs/releases/1.6.txt @@ -121,10 +121,10 @@ GeoDjango now provides :ref:`form fields and widgets ` for its geo-specialized fields. They are OpenLayers-based by default, but they can be customized to use any other JS framework. -``checksetup`` management command added for verifying compatibility -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +``check`` management command added for verifying compatibility +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -A ``checksetup`` management command was added, enabling you to verify if your +A ``check`` management command was added, enabling you to verify if your current configuration (currently oriented at settings) is compatible with the current version of Django. diff --git a/tests/check/__init__.py b/tests/check/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/tests/compat_checks/models.py b/tests/check/models.py similarity index 100% rename from tests/compat_checks/models.py rename to tests/check/models.py diff --git a/tests/compat_checks/tests.py b/tests/check/tests.py similarity index 86% rename from tests/compat_checks/tests.py rename to tests/check/tests.py index 879988c9051..98495e38ae3 100644 --- a/tests/compat_checks/tests.py +++ b/tests/check/tests.py @@ -1,6 +1,6 @@ -from django.core.compat_checks import base -from django.core.compat_checks import django_1_6_0 -from django.core.management.commands import checksetup +from django.core.checks.compatibility import base +from django.core.checks.compatibility import django_1_6_0 +from django.core.management.commands import check from django.core.management import call_command from django.test import TestCase @@ -86,22 +86,22 @@ class CompatChecksTestCase(TestCase): def test_management_command(self): # Again, we unfortunately have to patch out ``warnings``. Different - old_warnings = checksetup.warnings - checksetup.warnings = FakeWarnings() + old_warnings = check.warnings + check.warnings = FakeWarnings() - self.assertEqual(len(checksetup.warnings._warnings), 0) + self.assertEqual(len(check.warnings._warnings), 0) # Should not produce any warnings. with self.settings(TEST_RUNNER='myapp.test.CustomRunnner'): - call_command('checksetup') + call_command('check') - self.assertEqual(len(checksetup.warnings._warnings), 0) + self.assertEqual(len(check.warnings._warnings), 0) with self.settings(TEST_RUNNER='django.test.runner.DiscoverRunner'): - call_command('checksetup') + call_command('check') - self.assertEqual(len(checksetup.warnings._warnings), 1) - self.assertTrue("You have not explicitly set 'TEST_RUNNER'" in checksetup.warnings._warnings[0]) + self.assertEqual(len(check.warnings._warnings), 1) + self.assertTrue("You have not explicitly set 'TEST_RUNNER'" in check.warnings._warnings[0]) # Restore the ``warnings``. base.warnings = old_warnings