'Toggling show_toc on/off through the toc_depth field should
cause table of contents to appear/disappear.'

@pytest.mark.toc
def test_toc_depth(self):

    doc_content = '\n                                <h2>This    is    a    section</h2>\n                                <p>This    is    section    content.</p>\n                                <h2>This    is    another    section</h2>\n                                <p>This    is    more    section    content.</p>\n                                '
    r = revision(save=True, content=doc_content, is_approved=True)
    response = self.client.get(r.document.get_absolute_url())
    eq_(200, response.status_code)
    ok_(('<div    id="toc"' in response.content))
    new_r = revision(document=r.document, content=r.content, toc_depth=0, is_approved=True)
    new_r.save()
    response = self.client.get(r.document.get_absolute_url())
    eq_(200, response.status_code)
    ok_(('<div    class="page-toc">' not in response.content))
