diff options
Diffstat (limited to 'tests/regressiontests/test_runner')
4 files changed, 31 insertions, 0 deletions
diff --git a/tests/regressiontests/test_runner/deprecation_app/__init__.py b/tests/regressiontests/test_runner/deprecation_app/__init__.py new file mode 100644 index 0000000000..e69de29bb2 --- /dev/null +++ b/tests/regressiontests/test_runner/deprecation_app/__init__.py diff --git a/tests/regressiontests/test_runner/deprecation_app/models.py b/tests/regressiontests/test_runner/deprecation_app/models.py new file mode 100644 index 0000000000..71a8362390 --- /dev/null +++ b/tests/regressiontests/test_runner/deprecation_app/models.py @@ -0,0 +1,3 @@ +from django.db import models + +# Create your models here. diff --git a/tests/regressiontests/test_runner/deprecation_app/tests.py b/tests/regressiontests/test_runner/deprecation_app/tests.py new file mode 100644 index 0000000000..e676c3e3d5 --- /dev/null +++ b/tests/regressiontests/test_runner/deprecation_app/tests.py @@ -0,0 +1,9 @@ +import warnings + +from django.test import TestCase + +class DummyTest(TestCase): + def test_warn(self): + warnings.warn("warning from test", DeprecationWarning) + + diff --git a/tests/regressiontests/test_runner/tests.py b/tests/regressiontests/test_runner/tests.py index 5ef4d5537d..685e88d6ee 100644 --- a/tests/regressiontests/test_runner/tests.py +++ b/tests/regressiontests/test_runner/tests.py @@ -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, |
