[1.5.x] Fixed #18985 -- ensure module level deprecations are displayed

Also don't compete with -W CLI option.

Thanks to Aymeric Augustin for the catch, and Claude Paroz for the patch.

Backport of e79b857a07 from master.
This commit is contained in:
Preston Holmes 2013-03-24 21:34:46 -07:00 committed by Jacob Kaplan-Moss
parent 456d6c15db
commit 572a300e56
6 changed files with 40 additions and 22 deletions

View file

@ -298,7 +298,8 @@ class DeprecationDisplayTest(AdminScriptTestCase):
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)
self.assertIn("DeprecationWarning: warning from test", err)
self.assertIn("DeprecationWarning: module-level warning from deprecation_app", err)
@unittest.skipIf(sys.version_info[:2] == (2, 6),
"On Python 2.6, DeprecationWarnings are visible anyway")