diff options
| author | Chandrakant Kumar <k.03chandra@gmail.com> | 2017-06-16 08:47:17 -0400 |
|---|---|---|
| committer | Tim Graham <timograham@gmail.com> | 2017-06-16 11:06:01 -0400 |
| commit | f6800a081afa27eaee9229ad5ccfd86c6c61496d (patch) | |
| tree | 92a28b31e95e482015427f7236609deb7058032f | |
| parent | 874b1f2cac7b79597ce87cc244b7cefc5c5cd821 (diff) | |
Refs #27787 -- Corrected or removed invalid call_command() options.
| -rw-r--r-- | django/test/testcases.py | 14 | ||||
| -rw-r--r-- | tests/cache/tests.py | 10 | ||||
| -rw-r--r-- | tests/fixtures/tests.py | 6 |
3 files changed, 11 insertions, 19 deletions
diff --git a/django/test/testcases.py b/django/test/testcases.py index cc1da67fb2..6492144a2e 100644 --- a/django/test/testcases.py +++ b/django/test/testcases.py @@ -988,15 +988,11 @@ class TestCase(TransactionTestCase): if cls.fixtures: for db_name in cls._databases_names(include_mirrors=False): - try: - call_command('loaddata', *cls.fixtures, **{ - 'verbosity': 0, - 'commit': False, - 'database': db_name, - }) - except Exception: - cls._rollback_atomics(cls.cls_atomics) - raise + try: + call_command('loaddata', *cls.fixtures, **{'verbosity': 0, 'database': db_name}) + except Exception: + cls._rollback_atomics(cls.cls_atomics) + raise try: cls.setUpTestData() except Exception: diff --git a/tests/cache/tests.py b/tests/cache/tests.py index 2c6b50fe38..eb5865f08d 100644 --- a/tests/cache/tests.py +++ b/tests/cache/tests.py @@ -961,7 +961,7 @@ class DBCacheTests(BaseCacheTests, TransactionTestCase): self.drop_table() def create_table(self): - management.call_command('createcachetable', verbosity=0, interactive=False) + management.call_command('createcachetable', verbosity=0) def drop_table(self): with connection.cursor() as cursor: @@ -1042,9 +1042,7 @@ class CreateCacheTableForDBCacheTests(TestCase): def test_createcachetable_observes_database_router(self): # cache table should not be created on 'default' with self.assertNumQueries(0, using='default'): - management.call_command('createcachetable', - database='default', - verbosity=0, interactive=False) + management.call_command('createcachetable', database='default', verbosity=0) # cache table should be created on 'other' # Queries: # 1: check table doesn't already exist @@ -1054,9 +1052,7 @@ class CreateCacheTableForDBCacheTests(TestCase): # 5: release savepoint (if transactional DDL is supported) num = 5 if connections['other'].features.can_rollback_ddl else 3 with self.assertNumQueries(num, using='other'): - management.call_command('createcachetable', - database='other', - verbosity=0, interactive=False) + management.call_command('createcachetable', database='other', verbosity=0) class PicklingSideEffect: diff --git a/tests/fixtures/tests.py b/tests/fixtures/tests.py index fb9ba91d3d..477f64ce05 100644 --- a/tests/fixtures/tests.py +++ b/tests/fixtures/tests.py @@ -592,8 +592,8 @@ class FixtureLoadingTests(DumpDataAssertMixin, TestCase): def test_loading_using(self): # Load db fixtures 1 and 2. These will load using the 'default' database identifier explicitly - management.call_command('loaddata', 'db_fixture_1', verbosity=0, using='default') - management.call_command('loaddata', 'db_fixture_2', verbosity=0, using='default') + management.call_command('loaddata', 'db_fixture_1', verbosity=0, database='default') + management.call_command('loaddata', 'db_fixture_2', verbosity=0, database='default') self.assertQuerysetEqual(Article.objects.all(), [ '<Article: Who needs more than one database?>', '<Article: Who needs to use compressed data?>', @@ -604,7 +604,7 @@ class FixtureLoadingTests(DumpDataAssertMixin, TestCase): with self.assertRaisesMessage(CommandError, "No fixture named 'db_fixture_3' found."): management.call_command('loaddata', 'db_fixture_3', verbosity=0) with self.assertRaisesMessage(CommandError, "No fixture named 'db_fixture_3' found."): - management.call_command('loaddata', 'db_fixture_3', verbosity=0, using='default') + management.call_command('loaddata', 'db_fixture_3', verbosity=0, database='default') self.assertQuerysetEqual(Article.objects.all(), []) def test_output_formats(self): |
