'Test protected property cannot be deleted without read permission'

def test_prop_protection_with_delete_and_unpermitted_read(self):

    image_id = self._create_admin_image({'x-image-meta-property-x_owner_foo': 'bar'})
    another_request = unit_test_utils.get_fake_request(path=('/images/%s' % image_id), method='PUT')
    headers = {'x-auth-token': 'user:tenant:fake_role', 'X-Glance-Registry-Purge-Props': 'True'}
    for (k, v) in six.iteritems(headers):
        another_request.headers[k] = v
    output = another_request.get_response(self.api)
    self.assertEqual(http_client.OK, output.status_int)
    self.assertNotIn('x-image-meta-property-x_owner_foo', output.headers)
    another_request = unit_test_utils.get_fake_request(method='HEAD', path=('/images/%s' % image_id))
    headers = {'x-auth-token': 'user:tenant:admin'}
    for (k, v) in six.iteritems(headers):
        another_request.headers[k] = v
    output = another_request.get_response(self.api)
    self.assertEqual(http_client.OK, output.status_int)
    self.assertEqual('', output.body)
    self.assertEqual('bar', output.headers['x-image-meta-property-x_owner_foo'])
