'Toggling of table of contents in revisions'

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

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