Account for undocumented management command options used in tests

pull/4101/merge
Matt Westcott 2017-12-02 22:27:41 +00:00 zatwierdzone przez Karl Hobley
rodzic b87eed1cce
commit ed3cc5587c
4 zmienionych plików z 6 dodań i 5 usunięć

Wyświetl plik

@ -10,6 +10,7 @@ from wagtail.core.models import Page
class Command(BaseCommand):
help = "Checks for data integrity errors on the page tree, and fixes them where possible."
stealth_options = ('delete_orphans',)
def add_arguments(self, parser):
parser.add_argument(

Wyświetl plik

@ -114,7 +114,7 @@ class TestMovePagesCommand(TestCase):
fixtures = ['test.json']
def run_command(self, from_, to):
management.call_command('move_pages', str(from_), str(to), interactive=False, stdout=StringIO())
management.call_command('move_pages', str(from_), str(to), stdout=StringIO())
def test_move_pages(self):
# Get pages
@ -135,7 +135,7 @@ class TestSetUrlPathsCommand(TestCase):
fixtures = ['test.json']
def run_command(self):
management.call_command('set_url_paths', interactive=False, stdout=StringIO())
management.call_command('set_url_paths', stdout=StringIO())
def test_set_url_paths(self):
self.run_command()
@ -145,7 +145,7 @@ class TestReplaceTextCommand(TestCase):
fixtures = ['test.json']
def run_command(self, from_text, to_text):
management.call_command('replace_text', from_text, to_text, interactive=False, stdout=StringIO())
management.call_command('replace_text', from_text, to_text, stdout=StringIO())
def test_replace_text(self):
# Check that the christmas page is definitely about christmas

Wyświetl plik

@ -33,7 +33,7 @@ class BackendTests(WagtailTestUtils):
# no conf entry found - skip tests for this backend
raise unittest.SkipTest("No WAGTAILSEARCH_BACKENDS entry for the backend %s" % self.backend_path)
management.call_command('update_index', backend_name=self.backend_name, interactive=False, stdout=StringIO())
management.call_command('update_index', backend_name=self.backend_name, stdout=StringIO())
def assertUnsortedListEqual(self, a, b):
"""

Wyświetl plik

@ -137,7 +137,7 @@ class TestGarbageCollectCommand(TestCase):
SearchPromotion.objects.create(query=q, page_id=1, sort_order=0, description='Test')
promoted_querie_ids.append(q.id)
management.call_command('search_garbage_collect', interactive=False, stdout=StringIO())
management.call_command('search_garbage_collect', stdout=StringIO())
self.assertFalse(models.Query.objects.filter(id__in=querie_ids_to_be_deleted).exists())
self.assertFalse(models.QueryDailyHits.objects.filter(