Commit a0f1efc5 authored by Ivan Tyagov's avatar Ivan Tyagov

Test various styles (ODT, ODS) can produce printout with and without image in view form.

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@31701 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 44cbe8cc
...@@ -60,6 +60,14 @@ class TestOOoStyle(ERP5TypeTestCase, ZopeTestCase.Functional): ...@@ -60,6 +60,14 @@ class TestOOoStyle(ERP5TypeTestCase, ZopeTestCase.Functional):
person_module.pers.setFirstName('Bob') person_module.pers.setFirstName('Bob')
if person_module.pers._getOb('img', None) is None: if person_module.pers._getOb('img', None) is None:
person_module.pers.newContent(portal_type='Image', id='img') person_module.pers.newContent(portal_type='Image', id='img')
if person_module._getOb('pers_without_image', None) is None:
person = person_module.newContent(
portal_type='Person',
id = 'pers_without_image',
first_name = 'Test')
self.stepTic()
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
...@@ -215,6 +223,26 @@ class TestOOoStyle(ERP5TypeTestCase, ZopeTestCase.Functional): ...@@ -215,6 +223,26 @@ 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_form_view_embedded_image(self):
# with image
response = self.publish('/%s/person_module/pers/Person_viewDetails'
% 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())
# without image
response = self.publish('/%s/person_module/pers_without_image/Person_viewDetails'
% 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_report_view_encoding(self): def test_report_view_encoding(self):
self.portal.person_module.pers.setFirstName('Jérome') self.portal.person_module.pers.setFirstName('Jérome')
response = self.publish('/%s/person_module/pers/Base_viewHistory' response = self.publish('/%s/person_module/pers/Base_viewHistory'
......
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