'Test publishing a pending version isn\'t allowed.'

@mock.patch('mkt.webapps.tasks.index_webapps')
@mock.patch('mkt.webapps.tasks.update_cached_manifests')
@mock.patch('mkt.webapps.models.Webapp.update_supported_locales')
@mock.patch('mkt.webapps.models.Webapp.update_name_from_package_manifest')
def test_publicise_version_pending(self, update_name, update_locales, update_cached_manifests, index_webapps):

    ver = version_factory(addon=self.app, version='2.0', file_kw=dict(status=mkt.STATUS_PENDING))
    res = self.post()
    eq_(res.status_code, 302)
    eq_(self.get_latest_version_status(), mkt.STATUS_PENDING)
    assert (self.app.current_version != ver)
    assert (not update_name.called)
    assert (not update_locales.called)
