'Administrators of Deis should be able to manage all applications.'

@mock.patch(u'requests.post', mock_status_ok)
@mock.patch(u'api.models.logger')
def test_admin_can_manage_other_apps(self, mock_logger):

    user = User.objects.get(username=u'autotest2')
    token = Token.objects.get(user=user)
    app_id = u'autotest'
    url = u'/v1/apps'
    body = {u'id': app_id}
    response = self.client.post(url, json.dumps(body), content_type=u'application/json', HTTP_AUTHORIZATION=u'token    {}'.format(token))
    url = u'/v1/apps/{}'.format(app_id)
    response = self.client.get(url, HTTP_AUTHORIZATION=u'token    {}'.format(self.token))
    self.assertEqual(response.status_code, 200)
    exp_msg = u'autotest2    created    initial    release'
    exp_log_call = mock.call(logging.INFO, exp_msg)
    mock_logger.log.has_calls(exp_log_call)
    url = u'/v1/apps/{}'.format(app_id)
    response = self.client.delete(url, HTTP_AUTHORIZATION=u'token    {}'.format(self.token))
    self.assertEqual(response.status_code, 204)
