'Make sure we can create a document in a non-default locale.'

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

    get_current.return_value.domain = 'testserver'
    self.client.login(username='admin', password='testpass')
    data = new_document_data()
    doc_locale = 'es'
    self.client.post(reverse('wiki.new_document', locale=doc_locale), data, follow=True)
    d = Document.objects.get(title=data['title'])
    eq_(doc_locale, d.locale)
    assert ready_fire.called
