mirror of
https://github.com/django/django.git
synced 2025-08-03 18:38:50 +00:00
Fixed #23620 -- Used more specific assertions in the Django test suite.
This commit is contained in:
parent
c0c78f1b70
commit
f7969b0920
83 changed files with 419 additions and 429 deletions
|
@ -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):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue