Fixed #20509 - Proper parsing for dumpdata --pks option.

Thanks weipin for the report and Baptiste Mispelon for the patch.
This commit is contained in:
Tim Graham 2013-05-29 13:47:49 -04:00
parent 69f7db153d
commit 59235816bd
3 changed files with 24 additions and 4 deletions

View file

@ -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)