Removed redundant skip_checks option for call_command

This commit is contained in:
Claude Paroz 2014-10-19 21:25:09 +02:00
parent 6d11bb102d
commit b8f2c972d0
4 changed files with 6 additions and 13 deletions

View File

@ -274,7 +274,6 @@ class CreatesuperuserManagementCommandTestCase(TestCase):
email="joe@somewhere.org", email="joe@somewhere.org",
date_of_birth="1976-04-01", date_of_birth="1976-04-01",
stdout=new_io, stdout=new_io,
skip_checks=True
) )
command_output = new_io.getvalue().strip() command_output = new_io.getvalue().strip()
self.assertEqual(command_output, 'Superuser created successfully.') self.assertEqual(command_output, 'Superuser created successfully.')
@ -298,7 +297,6 @@ class CreatesuperuserManagementCommandTestCase(TestCase):
username="joe@somewhere.org", username="joe@somewhere.org",
stdout=new_io, stdout=new_io,
stderr=new_io, stderr=new_io,
skip_checks=True
) )
self.assertEqual(CustomUser._default_manager.count(), 0) self.assertEqual(CustomUser._default_manager.count(), 0)
@ -364,7 +362,6 @@ class CreatesuperuserManagementCommandTestCase(TestCase):
email=email.email, email=email.email,
group=group.pk, group=group.pk,
stdout=new_io, stdout=new_io,
skip_checks=True,
) )
command_output = new_io.getvalue().strip() command_output = new_io.getvalue().strip()
self.assertEqual(command_output, 'Superuser created successfully.') self.assertEqual(command_output, 'Superuser created successfully.')
@ -381,7 +378,6 @@ class CreatesuperuserManagementCommandTestCase(TestCase):
username=email.pk, username=email.pk,
email=non_existent_email, email=non_existent_email,
stdout=new_io, stdout=new_io,
skip_checks=True,
) )
@override_settings(AUTH_USER_MODEL='auth.CustomUserWithFK') @override_settings(AUTH_USER_MODEL='auth.CustomUserWithFK')
@ -402,7 +398,6 @@ class CreatesuperuserManagementCommandTestCase(TestCase):
interactive=True, interactive=True,
stdout=new_io, stdout=new_io,
stdin=MockTTY(), stdin=MockTTY(),
skip_checks=True,
) )
command_output = new_io.getvalue().strip() command_output = new_io.getvalue().strip()

View File

@ -351,8 +351,8 @@ class Command(BaseCommand):
for app_label in app_labels: for app_label in app_labels:
call_command( call_command(
'loaddata', 'initial_data', verbosity=self.verbosity, 'loaddata', 'initial_data', verbosity=self.verbosity,
database=connection.alias, skip_checks=True, database=connection.alias, app_label=app_label,
app_label=app_label, hide_empty=True, hide_empty=True,
) )
return created_models return created_models

View File

@ -22,7 +22,7 @@ class Command(BaseCommand):
def handle(self, **options): def handle(self, **options):
warnings.warn("The syncdb command will be removed in Django 1.9", RemovedInDjango19Warning) warnings.warn("The syncdb command will be removed in Django 1.9", RemovedInDjango19Warning)
call_command("migrate", skip_checks=True, **options) call_command("migrate", **options)
try: try:
apps.get_model('auth', 'Permission') apps.get_model('auth', 'Permission')
@ -41,5 +41,5 @@ class Command(BaseCommand):
confirm = input('Please enter either "yes" or "no": ') confirm = input('Please enter either "yes" or "no": ')
continue continue
if confirm == 'yes': if confirm == 'yes':
call_command("createsuperuser", interactive=True, database=options['database'], skip_checks=True) call_command("createsuperuser", interactive=True, database=options['database'])
break break

View File

@ -830,7 +830,7 @@ class TransactionTestCase(SimpleTestCase):
# We have to use this slightly awkward syntax due to the fact # We have to use this slightly awkward syntax due to the fact
# that we're using *args and **kwargs together. # that we're using *args and **kwargs together.
call_command('loaddata', *self.fixtures, call_command('loaddata', *self.fixtures,
**{'verbosity': 0, 'database': db_name, 'skip_checks': True}) **{'verbosity': 0, 'database': db_name})
def _post_teardown(self): def _post_teardown(self):
"""Performs any post-test things. This includes: """Performs any post-test things. This includes:
@ -864,8 +864,7 @@ class TransactionTestCase(SimpleTestCase):
for db_name in self._databases_names(include_mirrors=False): for db_name in self._databases_names(include_mirrors=False):
# Flush the database # Flush the database
call_command('flush', verbosity=0, interactive=False, call_command('flush', verbosity=0, interactive=False,
database=db_name, skip_checks=True, database=db_name, reset_sequences=False,
reset_sequences=False,
allow_cascade=self.available_apps is not None, allow_cascade=self.available_apps is not None,
inhibit_post_migrate=self.available_apps is not None) inhibit_post_migrate=self.available_apps is not None)
@ -931,7 +930,6 @@ class TestCase(TransactionTestCase):
'verbosity': 0, 'verbosity': 0,
'commit': False, 'commit': False,
'database': db_name, 'database': db_name,
'skip_checks': True,
}) })
except Exception: except Exception:
self._fixture_teardown() self._fixture_teardown()