Skip to content

Commit

Permalink
Use more expressive assertions.
Browse files Browse the repository at this point in the history
  • Loading branch information
Michael Howitz committed Jun 22, 2018
1 parent 078c1b5 commit 1217a65
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions src/DocumentTemplate/tests/testDTML.py
Original file line number Diff line number Diff line change
Expand Up @@ -520,8 +520,8 @@ def test_fmt_reST_include_directive_raises(self):
# The include: directive hasn't been rendered, it remains
# verbatimly in the rendered output. Instead a warning
# message is presented:
self.assertTrue(source in result)
self.assertTrue(docutils_include_warning in result)
self.assertIn(source, result)
self.assertIn(docutils_include_warning, result)

def test_fmt_reST_raw_directive_disabled(self):
EXPECTED = '<h1>HELLO WORLD</h1>'
Expand All @@ -533,9 +533,9 @@ def test_fmt_reST_raw_directive_disabled(self):
# The raw: directive hasn't been rendered, it remains
# verbatimly in the rendered output. Instead a warning
# message is presented:
self.assertTrue(EXPECTED not in result)
self.assertTrue(escape(EXPECTED) in result)
self.assertTrue(docutils_raw_warning in result)
self.assertNotIn(EXPECTED, result)
self.assertIn(escape(EXPECTED), result)
self.assertIn(docutils_raw_warning, result)

def test_fmt_reST_raw_directive_file_option_raises(self):
source = '.. raw:: html\n :file: inclusion.txt'
Expand All @@ -546,8 +546,8 @@ def test_fmt_reST_raw_directive_file_option_raises(self):
# The raw: directive hasn't been rendered, it remains
# verbatimly in the rendered output. Instead a warning
# message is presented:
self.assertTrue(source in result)
self.assertTrue(docutils_raw_warning in result)
self.assertIn(source, result)
self.assertIn(docutils_raw_warning, result)

def test_fmt_reST_raw_directive_url_option_raises(self):
source = '.. raw:: html\n :url: http://www.zope.org'
Expand All @@ -558,8 +558,8 @@ def test_fmt_reST_raw_directive_url_option_raises(self):
# The raw: directive hasn't been rendered, it remains
# verbatimly in the rendered output. Instead a warning
# message is presented:
self.assertTrue(source in result)
self.assertTrue(docutils_raw_warning in result)
self.assertIn(source, result)
self.assertIn(docutils_raw_warning, result)


def read_file(name):
Expand Down

0 comments on commit 1217a65

Please sign in to comment.