diff options
author | Berker Peksag <berker.peksag@gmail.com> | 2014-10-28 12:02:56 +0200 |
---|---|---|
committer | Tim Graham <timograham@gmail.com> | 2014-11-03 11:56:37 -0500 |
commit | f7969b0920c403118656f6bfec58d6454d79ef1a (patch) | |
tree | 866df7de0524251323fef2b4262e672150d95f00 /tests/admin_scripts/tests.py | |
parent | c0c78f1b707f825eee974c65515a837f8cf46e66 (diff) | |
download | django-f7969b0920c403118656f6bfec58d6454d79ef1a.tar.gz |
Fixed #23620 -- Used more specific assertions in the Django test suite.
Diffstat (limited to 'tests/admin_scripts/tests.py')
-rw-r--r-- | tests/admin_scripts/tests.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/tests/admin_scripts/tests.py b/tests/admin_scripts/tests.py index 5bc0fb3ee1..aaf4f17c75 100644 --- a/tests/admin_scripts/tests.py +++ b/tests/admin_scripts/tests.py @@ -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): |