'PUT API should allow overwrite of a specific section of an existing
document'

def test_put_section_edit(self):

    data = dict(content='\n                                                                <h3    id="S2">Section    2</h3>\n                                                                <p>This    is    an    edit    to    the    page.    We\'ve    dealt    with    it.</p>\n                                                ', title='Hahah    this    is    a    new    title!', tags='hello,quux,xyzzy', review_tags='technical')
    resp = self._put(('%s?section=S2' % self.url), data, HTTP_AUTHORIZATION=self.basic_auth)
    eq_(205, resp.status_code)
    expected = '\n                                                <h3    id="S1">Section    1</h3>\n                                                <p>This    is    a    page.    Deal    with    it.</p>\n                                                <h3    id="S2">Section    2</h3>\n                                                <p>This    is    an    edit    to    the    page.    We\'ve    dealt    with    it.</p>\n                                                <h3    id="S3">Section    3</h3>\n                                                <p>This    is    a    page.    Deal    with    it.</p>\n                                '
    curr_d = Document.objects.get(pk=self.doc.pk)
    eq_(normalize_html(expected.strip()), normalize_html(curr_d.html))
    eq_(data['title'], curr_d.title)
    d_tags = ','.join(sorted((t.name for t in curr_d.tags.all())))
    eq_(data['tags'], d_tags)
    curr_r = curr_d.current_revision
    ok_((self.rev.pk != curr_r.pk))
    r_tags = ','.join(sorted((t.name for t in curr_r.review_tags.all())))
    eq_(data['review_tags'], r_tags)
