def assert_body(self, expected, dedent=None):
__tracebackhide__ = True  <EOL>if dedent is None:<EOL><INDENT>dedent = self.dedent<EOL><DEDENT>if dedent:<EOL><INDENT>expected = dedent_string(expected)<EOL><DEDENT>body = get_body(self.html)<EOL>assert body == expected<EOL>return self<EOL>
Assert that the generated body matches the expectations.

Compares the generated HTML body against ``expected`` and raises
an ``AssertionError`` if they don't match.

If ``dedent`` is not given then its value at construction time
is used. If ``dedent`` is true then ``expected`` is passed
through ``dedent_string``.