mirror of
https://github.com/django/django.git
synced 2025-10-24 14:16:09 +00:00
Fixed #30595 -- Added error message when no objects found to sql* management commands.
This commit is contained in:
committed by
Mariusz Felisiak
parent
c2f381ef17
commit
5d03f2bc01
0
tests/empty_models/__init__.py
Normal file
0
tests/empty_models/__init__.py
Normal file
0
tests/empty_models/models.py
Normal file
0
tests/empty_models/models.py
Normal file
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')
|
||||
Reference in New Issue
Block a user