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:
@@ -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
|
||||
|
@@ -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', (
|
||||
|
Reference in New Issue
Block a user