Commit c98e1ff4 authored by Jérome Perrin's avatar Jérome Perrin

test rendering an ImageField in form_view, in right and bottom groups.


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@19843 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 99a091e5
...@@ -51,11 +51,13 @@ class TestOOoStyle(ERP5TypeTestCase, ZopeTestCase.Functional): ...@@ -51,11 +51,13 @@ class TestOOoStyle(ERP5TypeTestCase, ZopeTestCase.Functional):
self.auth = 'ERP5TypeTestCase:' self.auth = 'ERP5TypeTestCase:'
person_module = self.portal.person_module person_module = self.portal.person_module
if not hasattr(person_module, 'pers'): if person_module._getOb('pers', None) is None:
person_module.newContent(id='pers', portal_type='Person') person_module.newContent(id='pers', portal_type='Person')
get_transaction().commit() get_transaction().commit()
self.tic() self.tic()
person_module.pers.setFirstName('Bob') person_module.pers.setFirstName('Bob')
if person_module.pers._getOb('img', None) is None:
person_module.pers.newContent(portal_type='Image', id='img')
self.portal.changeSkin(self.skin) self.portal.changeSkin(self.skin)
self.validator = Validator() self.validator = Validator()
# make sure selections are empty # make sure selections are empty
...@@ -219,6 +221,29 @@ class TestOOoStyle(ERP5TypeTestCase, ZopeTestCase.Functional): ...@@ -219,6 +221,29 @@ class TestOOoStyle(ERP5TypeTestCase, ZopeTestCase.Functional):
self.assertEquals('inline', content_disposition.split(';')[0]) self.assertEquals('inline', content_disposition.split(';')[0])
self._validate(response.getBody()) self._validate(response.getBody())
def test_image_field_form_view(self):
response = self.publish(
'/%s/person_module/pers/img/Image_view'
% self.portal.getId(), basic=self.auth)
self.assertEquals(HTTP_OK, response.getStatus())
content_type = response.getHeader('content-type')
self.assertTrue(content_type.startswith(self.content_type), content_type)
content_disposition = response.getHeader('content-disposition')
self.assertEquals('inline', content_disposition.split(';')[0])
self._validate(response.getBody())
def test_image_field_form_view_bottom_group(self):
response = self.publish(
'/%s/person_module/pers/img/Image_viewFullSizedImage'
% self.portal.getId(), basic=self.auth)
self.assertEquals(HTTP_OK, response.getStatus())
content_type = response.getHeader('content-type')
self.assertTrue(content_type.startswith(self.content_type), content_type)
content_disposition = response.getHeader('content-disposition')
self.assertEquals('inline', content_disposition.split(';')[0])
self._validate(response.getBody())
class TestODTStyle(TestOOoStyle): class TestODTStyle(TestOOoStyle):
skin = 'ODT' skin = 'ODT'
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment