def delete(self, context, image_id):
        # NOTE(vish): show is to check if image is available
        image_meta = self.show(context, image_id)

        if FLAGS.use_deprecated_auth:
            # NOTE(parthi): only allow image deletions if the user
            # is a member of the project owning the image, in case of
            # setup without keystone
            # TODO Currently this access control breaks if
            # 1. Image is not owned by a project
            # 2. Deleting user is not bound a project
            properties = image_meta['properties']
            if (context.project_id and ('project_id' in properties)
                and (context.project_id != properties['project_id'])):
                raise exception.NotAuthorized(_("Not the image owner"))

            if (context.project_id and ('owner_id' in properties)
                and (context.project_id != properties['owner_id'])):
                raise exception.NotAuthorized(_("Not the image owner"))

        try:
            result = self._get_client(context).delete_image(image_id)
        except glance_exception.NotFound:
            raise exception.ImageNotFound(image_id=image_id)
        return result
Example test for content on a given view, this time using the BeautifulSoup parser
dataset/ETHPy150Open nii-cloud/dodai-compute/nova/image/glance.py/GlanceImageService.delete--crossover with--dataset/ETHPy150Open garethr/django-test-extensions/src/test_extensions/examples/examples.py/Examples.test_using_beautiful_soup