summaryrefslogtreecommitdiffstats
path: root/tests/test_pages.py
diff options
context:
space:
mode:
authorFrédéric Péters <fpeters@entrouvert.com>2017-04-02 12:29:10 (GMT)
committerFrédéric Péters <fpeters@entrouvert.com>2017-04-06 20:58:36 (GMT)
commit48065634d287992a36eead17b634b0c2dcb18d4b (patch)
treef787d450bea2f91a5fb34374cfe4f7736470a6d4 /tests/test_pages.py
parent76007e9fd5eafdbbacea498efdec67a8deb9e224 (diff)
downloadcombo-48065634d287992a36eead17b634b0c2dcb18d4b.zip
combo-48065634d287992a36eead17b634b0c2dcb18d4b.tar.gz
combo-48065634d287992a36eead17b634b0c2dcb18d4b.tar.bz2
general: enhance import/export cmdline commands (#15665)
This unifies behaviour with other publik components, it adds support for stdin/stdout using '-' as filename, and adds if-empty and clean flags to the import command.
Diffstat (limited to 'tests/test_pages.py')
-rw-r--r--tests/test_pages.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/tests/test_pages.py b/tests/test_pages.py
index 9b6c4ad..0d076b3 100644
--- a/tests/test_pages.py
+++ b/tests/test_pages.py
@@ -224,13 +224,13 @@ def test_import_export_management_commands():
os.unlink(export_filename)
cmd = ExportSiteCommand()
- cmd.handle(export_filename)
+ cmd.handle(output=export_filename)
assert os.path.exists(export_filename)
stdout = sys.stdout
try:
sys.stdout = StringIO()
- cmd.handle('-')
+ cmd.handle(output='-')
assert sys.stdout.getvalue() == open(export_filename).read()
finally:
sys.stdout = stdout
@@ -238,7 +238,7 @@ def test_import_export_management_commands():
Page.objects.all().delete()
cmd = ImportSiteCommand()
- cmd.handle(export_filename)
+ cmd.handle(filename=export_filename, if_empty=False, clean=False)
new_page_1 = Page.objects.all().order_by('order')[0]
new_page_2 = Page.objects.all().order_by('order')[1]