diff --git a/wagtail/tests/utils.py b/wagtail/tests/utils.py
index b488b475f..9ea4cfe68 100644
--- a/wagtail/tests/utils.py
+++ b/wagtail/tests/utils.py
@@ -156,6 +156,9 @@ class WagtailTestUtils(object):
else:
self.assertTrue(real_count != 0, msg_prefix + "Couldn't find '%s' in response" % needle)
+ def assertNotInHTML(self, needle, haystack, msg_prefix=''):
+ self.assertInHTML(needle, haystack, count=0, msg_prefix=msg_prefix)
+
class WagtailPageTests(WagtailTestUtils, TestCase):
"""
diff --git a/wagtail/wagtailcore/tests/test_blocks.py b/wagtail/wagtailcore/tests/test_blocks.py
index 348c9e5b6..7dd2c53c3 100644
--- a/wagtail/wagtailcore/tests/test_blocks.py
+++ b/wagtail/wagtailcore/tests/test_blocks.py
@@ -22,6 +22,7 @@ from django.utils.translation import ugettext_lazy as __
from wagtail.tests.testapp.blocks import LinkBlock as CustomLinkBlock
from wagtail.tests.testapp.blocks import SectionBlock
from wagtail.tests.testapp.models import EventPage, SimplePage
+from wagtail.tests.utils import WagtailTestUtils
from wagtail.utils.deprecation import RemovedInWagtail111Warning
from wagtail.wagtailcore import blocks
from wagtail.wagtailcore.models import Page
@@ -50,7 +51,7 @@ class ContextCharBlock(blocks.CharBlock):
return super(blocks.CharBlock, self).get_context(value, parent_context)
-class TestFieldBlock(SimpleTestCase):
+class TestFieldBlock(SimpleTestCase, WagtailTestUtils):
def test_charfield_render(self):
block = blocks.CharBlock()
html = block.render("Hello world!")
@@ -145,9 +146,9 @@ class TestFieldBlock(SimpleTestCase):
html = block.render_form('choice-2')
self.assertIn('
', html)
- self.assertInHTML('