'HTTP POST to new revision URL creates the revision on a document.
The document in this case doesn\'t have a current_revision, therefore
the document fields are open for editing.'

@mock.patch.object(ReviewableRevisionInLocaleEvent, 'fire')
@mock.patch.object(EditDocumentEvent, 'fire')
@mock.patch.object(Site.objects, 'get_current')
def test_new_revision_POST_document_without_current(self, get_current, edited_fire, ready_fire):

    get_current.return_value.domain = 'testserver'
    self.d.current_revision = None
    self.d.save()
    data = new_document_data()
    data['form'] = 'rev'
    response = self.client.post(reverse('wiki.edit_document', args=[self.d.slug]), data)
    eq_(302, response.status_code)
    eq_(2, self.d.revisions.count())
    new_rev = self.d.revisions.order_by('-id')[0]
    eq_(None, new_rev.based_on)
    assert edited_fire.called
    assert ready_fire.called
