Fixed Django 1.7+ deprecation warning for requires_model_validation

See https://docs.djangoproject.com/en/1.8/howto/custom-management-commands/#django.core.management.BaseCommand.requires_system_checks

Also removed a rather low value test which wasn't worth rewriting.
This commit is contained in:
Luke Plant
2015-10-23 11:13:03 +01:00
parent c76f76bdd4
commit 544a63779c
2 changed files with 6 additions and 5 deletions

View File

@@ -60,8 +60,6 @@ class Command(NoArgsCommand):
dest="engine"),
)
requires_model_validation = False
def get_loaders(self):
if django.VERSION < (1, 8):
from django.template.loader import template_source_loaders
@@ -302,3 +300,9 @@ class Command(NoArgsCommand):
"Offline compression is disabled. Set "
"COMPRESS_OFFLINE or use the --force to override.")
self.compress(sys.stdout, **options)
if django.VERSION < (1, 7):
Command.requires_model_validation = False
else:
Command.requires_system_checks = False

View File

@@ -201,9 +201,6 @@ class OfflineCompressBasicTestCase(OfflineTestCaseMixin, TestCase):
for engine in self.engines:
self._test_deleting_manifest_does_not_affect_rendering(engine)
def test_requires_model_validation(self):
self.assertFalse(CompressCommand.requires_model_validation)
def test_get_loaders(self):
TEMPLATE_LOADERS = (
('django.template.loaders.cached.Loader', (