mirror of
https://github.com/django/django.git
synced 2025-09-26 12:09:19 +00:00
[1.5.x] Fixed #19546 - ensure that deprecation warnings are shown during tests
refs #18985
This commit is contained in:
parent
7c39e041b1
commit
af8e858c15
6 changed files with 59 additions and 8 deletions
|
@ -279,6 +279,25 @@ class DummyBackendTest(unittest.TestCase):
|
|||
db.connections = old_db_connections
|
||||
|
||||
|
||||
class DeprecationDisplayTest(AdminScriptTestCase):
|
||||
# tests for 19546
|
||||
def setUp(self):
|
||||
settings = {'INSTALLED_APPS': '("regressiontests.test_runner.deprecation_app",)' }
|
||||
self.write_settings('settings.py', sdict=settings)
|
||||
|
||||
def tearDown(self):
|
||||
self.remove_settings('settings.py')
|
||||
|
||||
def test_runner_deprecation_verbosity_default(self):
|
||||
args = ['test', '--settings=regressiontests.settings']
|
||||
out, err = self.run_django_admin(args)
|
||||
self.assertTrue("DeprecationWarning: warning from test" in err)
|
||||
|
||||
def test_runner_deprecation_verbosity_zero(self):
|
||||
args = ['test', '--settings=regressiontests.settings', '--verbosity=0']
|
||||
out, err = self.run_django_admin(args)
|
||||
self.assertFalse("DeprecationWarning: warning from test" in err)
|
||||
|
||||
class AutoIncrementResetTest(TransactionTestCase):
|
||||
"""
|
||||
Here we test creating the same model two times in different test methods,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue