Remove is_public from domain layer

The pre-reserved attribute 'is_public' has been removed from the
api layer, this patch will remove it from the domain layer and add
an unit test for that.

Closes-Bug: #1452447

Change-Id: Ie75088d95e7e0ae53df5290b33f3a184adc22239
This commit is contained in:
Fei Long Wang 2015-05-07 11:42:26 +12:00
parent bcc7721550
commit b6c1893863
2 changed files with 8 additions and 3 deletions

View File

@ -53,9 +53,8 @@ def _import_delayed_delete():
class ImageFactory(object):
_readonly_properties = ['created_at', 'updated_at', 'status', 'checksum',
'size', 'virtual_size']
_reserved_properties = ['owner', 'is_public', 'locations',
'deleted', 'deleted_at', 'direct_url', 'self',
'file', 'schema']
_reserved_properties = ['owner', 'locations', 'deleted', 'deleted_at',
'direct_url', 'self', 'file', 'schema']
def _check_readonly(self, kwargs):
for key in self._readonly_properties:

View File

@ -119,6 +119,12 @@ class TestImageFactory(test_utils.BaseTestCase):
self.image_factory.new_image, image_id=UUID1,
extra_properties=extra_properties)
def test_new_image_for_is_public(self):
extra_prop = {'is_public': True}
new_image = self.image_factory.new_image(image_id=UUID1,
extra_properties=extra_prop)
self.assertEqual(True, new_image.extra_properties['is_public'])
class TestImage(test_utils.BaseTestCase):