Fixed #23620 -- Used more specific assertions in the Django test suite.

This commit is contained in:
Berker Peksag 2014-10-28 12:02:56 +02:00 committed by Tim Graham
parent c0c78f1b70
commit f7969b0920
83 changed files with 419 additions and 429 deletions

View file

@ -190,12 +190,12 @@ class AdminScriptTestCase(unittest.TestCase):
self.assertIsNotNone(re.search(msg, stream),
"'%s' does not match actual output text '%s'" % (msg, stream))
else:
self.assertTrue(msg in stream, "'%s' does not match actual output text '%s'" % (msg, stream))
self.assertIn(msg, stream, "'%s' does not match actual output text '%s'" % (msg, stream))
def assertNotInOutput(self, stream, msg):
"Utility assertion: assert that the given message doesn't exist in the output"
stream = force_text(stream)
self.assertFalse(msg in stream, "'%s' matches actual output text '%s'" % (msg, stream))
self.assertNotIn(msg, stream, "'%s' matches actual output text '%s'" % (msg, stream))
##########################################################################
# DJANGO ADMIN TESTS
@ -904,7 +904,7 @@ class ManageAlternateSettings(AdminScriptTestCase):
out, err = self.run_manage(args)
expected = ('create table %s'
% connection.ops.quote_name('admin_scripts_article'))
self.assertTrue(expected.lower() in out.lower())
self.assertIn(expected.lower(), out.lower())
self.assertNoOutput(err)
def test_builtin_with_environment(self):
@ -913,7 +913,7 @@ class ManageAlternateSettings(AdminScriptTestCase):
out, err = self.run_manage(args, 'alternate_settings')
expected = ('create table %s'
% connection.ops.quote_name('admin_scripts_article'))
self.assertTrue(expected.lower() in out.lower())
self.assertIn(expected.lower(), out.lower())
self.assertNoOutput(err)
def test_builtin_with_bad_settings(self):