'The raw source for a document can be requested, with section editing
links'

def test_raw_with_editing_links_source(self):

    self.client.login(username='admin', password='testpass')
    rev = revision(is_approved=True, save=True, content='\n                                                <h1    id="s1">s1</h1>\n                                                <p>test</p>\n                                                <p>test</p>\n\n                                                <h1    id="s2">s2</h1>\n                                                <p>test</p>\n                                                <p>test</p>\n\n                                                <h1    id="s3">s3</h1>\n                                                <p>test</p>\n                                                <p>test</p>\n                                ')
    expected = ('\n                                                <h1    id="s1"><a    class="edit-section"    data-section-id="s1"    data-section-src-url="/en-US/docs/%(slug)s?raw=true&amp;section=s1"    href="/en-US/docs/%(slug)s$edit?section=s1&amp;edit_links=true"    title="Edit    section">Edit</a>s1</h1>\n                                                <p>test</p>\n                                                <p>test</p>\n                                                <h1    id="s2"><a    class="edit-section"    data-section-id="s2"    data-section-src-url="/en-US/docs/%(slug)s?raw=true&amp;section=s2"    href="/en-US/docs/%(slug)s$edit?section=s2&amp;edit_links=true"    title="Edit    section">Edit</a>s2</h1>\n                                                <p>test</p>\n                                                <p>test</p>\n                                                <h1    id="s3"><a    class="edit-section"    data-section-id="s3"    data-section-src-url="/en-US/docs/%(slug)s?raw=true&amp;section=s3"    href="/en-US/docs/%(slug)s$edit?section=s3&amp;edit_links=true"    title="Edit    section">Edit</a>s3</h1>\n                                                <p>test</p>\n                                                <p>test</p>\n                                ' % {'slug': rev.document.slug})
    response = self.client.get(('%s?raw=true&edit_links=true' % reverse('wiki.document', args=[rev.document.slug])), HTTP_X_REQUESTED_WITH='XMLHttpRequest')
    eq_(normalize_html(expected), normalize_html(response.content))
