'HTTP POST to new document URL creates the document.'

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

    get_current.return_value.domain = 'testserver'
    self.client.login(username='admin', password='testpass')
    data = new_document_data()
    response = self.client.post(reverse('wiki.new_document'), data, follow=True)
    d = Document.objects.get(title=data['title'])
    eq_([(('http://testserver/en-US/kb/%s/history' % d.slug), 302)], response.redirect_chain)
    eq_(settings.WIKI_DEFAULT_LANGUAGE, d.locale)
    eq_(data['category'], d.category)
    r = d.revisions.all()[0]
    eq_(data['keywords'], r.keywords)
    eq_(data['summary'], r.summary)
    eq_(data['content'], r.content)
    assert ready_fire.called
