[Erp5-report] r38517 kazuhiko - /erp5/trunk/products/ERP5/tests/testERP5WebWithDms.py

nobody at svn.erp5.org nobody at svn.erp5.org
Tue Sep 21 15:15:51 CEST 2010


Author: kazuhiko
Date: Tue Sep 21 15:15:49 2010
New Revision: 38517

URL: http://svn.erp5.org?rev=38517&view=rev
Log:
check 'html preview of an OOo document with images' with /acl_users user too, that will fail for now.

Modified:
    erp5/trunk/products/ERP5/tests/testERP5WebWithDms.py

Modified: erp5/trunk/products/ERP5/tests/testERP5WebWithDms.py
URL: http://svn.erp5.org/erp5/trunk/products/ERP5/tests/testERP5WebWithDms.py?rev=38517&r1=38516&r2=38517&view=diff
==============================================================================
--- erp5/trunk/products/ERP5/tests/testERP5WebWithDms.py [utf8] (original)
+++ erp5/trunk/products/ERP5/tests/testERP5WebWithDms.py [utf8] Tue Sep 21 15:15:49 2010
@@ -569,6 +569,8 @@ class TestERP5WebWithDms(ERP5TypeTestCas
     portal = self.portal
     request = portal.REQUEST
     request['PARENTS'] = [self.app]
+    self.getPortalObject().aq_parent.acl_users._doAddUser(
+      'zope_user', '', ['Manager',], [])
     website = self.setupWebSite()
     web_section_portal_type = 'Web Section'
     web_section = website.newContent(portal_type=web_section_portal_type)
@@ -581,26 +583,27 @@ class TestERP5WebWithDms(ERP5TypeTestCas
                                           file=upload_file)
     transaction.commit()
     self.tic()
-    credential = 'ERP5TypeTestCase:'
+    credential_list = ['ERP5TypeTestCase:', 'zope_user:']
 
-    # first, preview the draft in its physical location (in document module)
-    response = self.publish('%s/asEntireHTML' % document.absolute_url_path(),
-                            credential)
-    self.assertEquals(response.getHeader('content-type'), 'text/html')
-    html = response.getBody()
-    self.assertTrue('<img' in html, html)
-    
-    # find the img src
-    img_list = etree.HTML(html).findall('.//img')
-    self.assertEquals(1, len(img_list))
-    src = img_list[0].get('src')
-
-    # and make another query for this img
-    response = self.publish('%s/%s' % ( document.absolute_url_path(), src),
-                            credential)
-    self.assertEquals(response.getHeader('content-type'), 'image/png')
-    png = response.getBody()
-    self.assertTrue(png.startswith('\x89PNG'))
+    for credential in credential_list:
+      # first, preview the draft in its physical location (in document module)
+      response = self.publish('%s/asEntireHTML' % document.absolute_url_path(),
+                              credential)
+      self.assertEquals(response.getHeader('content-type'), 'text/html')
+      html = response.getBody()
+      self.assertTrue('<img' in html, html)
+
+      # find the img src
+      img_list = etree.HTML(html).findall('.//img')
+      self.assertEquals(1, len(img_list))
+      src = img_list[0].get('src')
+
+      # and make another query for this img
+      response = self.publish('%s/%s' % ( document.absolute_url_path(), src),
+                              credential)
+      self.assertEquals(response.getHeader('content-type'), 'image/png')
+      png = response.getBody()
+      self.assertTrue(png.startswith('\x89PNG'))
 
     # then publish the document and access it anonymously by reference through
     # the web site




More information about the Erp5-report mailing list