mirror of
https://github.com/django/django.git
synced 2025-08-31 07:47:37 +00:00
Fixed #20509 - Proper parsing for dumpdata --pks option.
Thanks weipin for the report and Baptiste Mispelon for the patch.
This commit is contained in:
parent
69f7db153d
commit
59235816bd
3 changed files with 24 additions and 4 deletions
|
@ -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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue