'An unauthorized user should not be able to modify other builds.
Since an unauthorized user can\'t access the application, these
requests should return a 403.'

@mock.patch(u'requests.post', mock_status_ok)
def test_unauthorized_user_cannot_modify_build(self):

    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(self.token))
    unauthorized_user = User.objects.get(username=u'autotest2')
    unauthorized_token = Token.objects.get(user=unauthorized_user).key
    url = u'{}/{}/builds'.format(url, app_id)
    body = {u'image': u'foo'}
    response = self.client.post(url, json.dumps(body), content_type=u'application/json', HTTP_AUTHORIZATION=u'token    {}'.format(unauthorized_token))
    self.assertEqual(response.status_code, 403)
