[Erp5-report] r31959 nicolas - /erp5/trunk/products/ERP5/tests/
nobody at svn.erp5.org
nobody at svn.erp5.org
Mon Jan 25 18:30:01 CET 2010
Author: nicolas
Date: Mon Jan 25 18:29:59 2010
New Revision: 31959
URL: http://svn.erp5.org?rev=31959&view=rev
Log:
Split Caching Policy Manager test to dedicated test suite for Text document handling.
approved by Romain
Modified:
erp5/trunk/products/ERP5/tests/testERP5Web.py
erp5/trunk/products/ERP5/tests/testERP5WebWithDms.py
Modified: erp5/trunk/products/ERP5/tests/testERP5Web.py
URL: http://svn.erp5.org/erp5/trunk/products/ERP5/tests/testERP5Web.py?rev=31959&r1=31958&r2=31959&view=diff
==============================================================================
--- erp5/trunk/products/ERP5/tests/testERP5Web.py [utf8] (original)
+++ erp5/trunk/products/ERP5/tests/testERP5Web.py [utf8] Mon Jan 25 18:29:59 2010
@@ -1182,9 +1182,8 @@
def test_15_Check_LastModified_Header(self):
"""Checks that Last-Modified header set by caching policy manager
is correctly filled with getModificationDate of content.
- This test check all Policy installed by erp5_web:
+ This test check 2 Policy installed by erp5_web:
Policy ID - unauthenticated web pages
- unauthenticated
authenticated
"""
request = self.portal.REQUEST
@@ -1217,24 +1216,6 @@
response = self.publish(path, 'webmaster:webmaster')
last_modified_header = response.getHeader('Last-Modified')
self.assertTrue(last_modified_header)
- from App.Common import rfc1123_date
- # Convert the Date into string according RFC 1123 Time Format
- modification_date = rfc1123_date(document.getModificationDate())
- self.assertEqual(modification_date, last_modified_header)
-
- # unauthenticated
- document_portal_type = 'Text'
- document_module = self.portal.getDefaultModule(document_portal_type)
- document = document_module.newContent(portal_type=document_portal_type,
- reference='NXD-Document-TEXT.Cache')
- document.publish()
- transaction.commit()
- self.tic()
- path = website.absolute_url_path() + '/NXD-Document-TEXT.Cache'
- response = self.publish(path)
- last_modified_header = response.getHeader('Last-Modified')
- self.assertTrue(last_modified_header)
- from App.Common import rfc1123_date
# Convert the Date into string according RFC 1123 Time Format
modification_date = rfc1123_date(document.getModificationDate())
self.assertEqual(modification_date, last_modified_header)
Modified: erp5/trunk/products/ERP5/tests/testERP5WebWithDms.py
URL: http://svn.erp5.org/erp5/trunk/products/ERP5/tests/testERP5WebWithDms.py?rev=31959&r1=31958&r2=31959&view=diff
==============================================================================
--- erp5/trunk/products/ERP5/tests/testERP5WebWithDms.py [utf8] (original)
+++ erp5/trunk/products/ERP5/tests/testERP5WebWithDms.py [utf8] Mon Jan 25 18:29:59 2010
@@ -1,3 +1,4 @@
+# -*- coding: utf-8 -*-
##############################################################################
#
# Copyright (c) 2009 Nexedi SA and Contributors. All Rights Reserved.
@@ -386,6 +387,33 @@
field.get_value('form_id'),
field.get_value('field_id')))
+ def test_06_Check_LastModified_Header(self):
+ """Checks that Last-Modified header set by caching policy manager
+ is correctly filled with getModificationDate of content.
+ This test check "unauthenticated" Policy installed by erp5_web:
+ """
+ request = self.portal.REQUEST
+ website = self.setupWebSite()
+ web_section_portal_type = 'Web Section'
+ web_section = website.newContent(portal_type=web_section_portal_type)
+
+ # unauthenticated
+ document_portal_type = 'Text'
+ document_module = self.portal.getDefaultModule(document_portal_type)
+ document = document_module.newContent(portal_type=document_portal_type,
+ reference='NXD-Document-TEXT.Cache')
+ document.publish()
+ transaction.commit()
+ self.tic()
+ path = website.absolute_url_path() + '/NXD-Document-TEXT.Cache'
+ response = self.publish(path)
+ last_modified_header = response.getHeader('Last-Modified')
+ self.assertTrue(last_modified_header)
+ from App.Common import rfc1123_date
+ # Convert the Date into string according RFC 1123 Time Format
+ modification_date = rfc1123_date(document.getModificationDate())
+ self.assertEqual(modification_date, last_modified_header)
+
def test_suite():
suite = unittest.TestSuite()
suite.addTest(unittest.makeSuite(TestERP5WebWithDms))
More information about the Erp5-report
mailing list