summaryrefslogtreecommitdiff
path: root/tests/admin_scripts
diff options
context:
space:
mode:
authorTim Graham <timograham@gmail.com>2013-05-29 13:47:49 -0400
committerTim Graham <timograham@gmail.com>2013-05-30 10:19:13 -0400
commit59235816bd063cb8b24acfc92ae1b5cd09a1f7ba (patch)
tree020866120dbb5249daa275c9c79f7e392fee5826 /tests/admin_scripts
parent69f7db153d8108dcef033207d49f4c80febf3d70 (diff)
Fixed #20509 - Proper parsing for dumpdata --pks option.
Thanks weipin for the report and Baptiste Mispelon for the patch.
Diffstat (limited to 'tests/admin_scripts')
-rw-r--r--tests/admin_scripts/tests.py19
1 files changed, 19 insertions, 0 deletions
diff --git a/tests/admin_scripts/tests.py b/tests/admin_scripts/tests.py
index f0ef0fb293..9e6b1f557b 100644
--- a/tests/admin_scripts/tests.py
+++ b/tests/admin_scripts/tests.py
@@ -1682,3 +1682,22 @@ class DiffSettings(AdminScriptTestCase):
out, err = self.run_manage(args)
self.assertNoOutput(err)
self.assertOutput(out, "### STATIC_URL = None")
+
+class Dumpdata(AdminScriptTestCase):
+ """Tests for dumpdata management command."""
+
+ def setUp(self):
+ self.write_settings('settings.py')
+
+ def tearDown(self):
+ self.remove_settings('settings.py')
+
+ def test_pks_parsing(self):
+ """Regression for #20509
+
+ Test would raise an exception rather than printing an error message.
+ """
+ args = ['dumpdata', '--pks=1']
+ out, err = self.run_manage(args)
+ self.assertOutput(err, "You can only use --pks option with one model")
+ self.assertNoOutput(out)