'The raw source for a document can be requested'

def test_raw_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">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                                '
    Switch.objects.create(name='application_ACAO', active=True)
    response = self.client.get(('%s?raw=true' % reverse('wiki.document', args=[rev.document.slug])), HTTP_X_REQUESTED_WITH='XMLHttpRequest')
    ok_(('Access-Control-Allow-Origin' in response))
    eq_('*', response['Access-Control-Allow-Origin'])
    eq_(normalize_html(expected), normalize_html(response.content))
