mirror of
https://github.com/django/django.git
synced 2025-07-24 13:44:32 +00:00
Fixed #30595 -- Added error message when no objects found to sql* management commands.
This commit is contained in:
parent
c2f381ef17
commit
5d03f2bc01
9 changed files with 38 additions and 1 deletions
18
tests/empty_models/test_commands.py
Normal file
18
tests/empty_models/test_commands.py
Normal file
|
@ -0,0 +1,18 @@
|
|||
import io
|
||||
|
||||
from django.core.management import call_command
|
||||
from django.test import TestCase
|
||||
|
||||
|
||||
class CoreCommandsNoOutputTests(TestCase):
|
||||
available_apps = ['empty_models']
|
||||
|
||||
def test_sqlflush_no_tables(self):
|
||||
err = io.StringIO()
|
||||
call_command('sqlflush', stderr=err)
|
||||
self.assertEqual(err.getvalue(), 'No tables found.\n')
|
||||
|
||||
def test_sqlsequencereset_no_sequences(self):
|
||||
err = io.StringIO()
|
||||
call_command('sqlsequencereset', 'empty_models', stderr=err)
|
||||
self.assertEqual(err.getvalue(), 'No sequences found.\n')
|
Loading…
Add table
Add a link
Reference in a new issue