'Toggling of table of contents in revisions'

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

    self.client.login(username='admin', password='testpass')
    rev = revision(is_approved=True, save=True)
    new_r = revision(document=rev.document, content=rev.content, toc_depth=0, is_approved=True)
    new_r.save()
    ok_((not Document.objects.get(slug=rev.document.slug, locale=rev.document.locale).show_toc))
    data = new_document_data()
    data['form-type'] = 'rev'
    data['slug'] = rev.document.slug
    data['title'] = rev.document.title
    self.client.post(reverse('wiki.edit', args=[rev.document.slug]), data)
    ok_(Document.objects.get(slug=rev.document.slug, locale=rev.document.locale).show_toc)
