Commit 009dcac9 authored by Jérome Perrin's avatar Jérome Perrin

fixup! downloadable: Always set content-disposition: inline when displaying inline

test was lost in merge / rebase
parent 78867757
......@@ -188,7 +188,7 @@ class TestOOoStyle(ERP5TypeTestCase, ZopeTestCase.Functional):
self.assertEqual('attachment', content_disposition.split(';')[0])
self._validate(response.getBody())
def test_form_view_format(self):
def test_form_view_empty_format(self):
# empty format= does not use oood for conversion
response = self.publish(
'/%s/person_module/pers/Person_view?format='
......@@ -199,6 +199,8 @@ class TestOOoStyle(ERP5TypeTestCase, ZopeTestCase.Functional):
content_disposition = response.getHeader('content-disposition')
self.assertEqual('attachment', content_disposition.split(';')[0])
self._validate(response.getBody())
def test_form_view_pdf_format(self):
# format=pdf uses oood for conversion
response = self.publish(
'/%s/person_module/pers/Person_view?format=pdf'
......@@ -209,6 +211,17 @@ class TestOOoStyle(ERP5TypeTestCase, ZopeTestCase.Functional):
content_disposition = response.getHeader('content-disposition')
self.assertEqual('attachment', content_disposition.split(';')[0])
def test_form_view_html_format(self):
# format=html is rendered inline
response = self.publish(
'/%s/person_module/pers/Person_view?format=html'
% self.portal.getId(), self.auth)
self.assertEqual(HTTP_OK, response.getStatus())
content_type = response.getHeader('content-type')
self.assertEqual(content_type, 'text/html; charset=utf-8')
content_disposition = response.getHeader('content-disposition')
self.assertEqual('inline', content_disposition.split(';')[0])
def test_report_view_form_view(self):
# Test report view rendering forms using form_view
self.assertEqual('form_view', self.portal.Base_viewWorkflowHistory.pt)
......
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