本文整理汇总了Python中Products.CMFCore.tests.base.dummy.DummyContent.modified_date方法的典型用法代码示例。如果您正苦于以下问题:Python DummyContent.modified_date方法的具体用法?Python DummyContent.modified_date怎么用?Python DummyContent.modified_date使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Products.CMFCore.tests.base.dummy.DummyContent
的用法示例。
在下文中一共展示了DummyContent.modified_date方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_304_response_from_cpm
# 需要导入模块: from Products.CMFCore.tests.base.dummy import DummyContent [as 别名]
# 或者: from Products.CMFCore.tests.base.dummy.DummyContent import modified_date [as 别名]
def test_304_response_from_cpm(self):
# test that we get a 304 response from the cpm via this template
mod_time = DateTime()
cpm = DummyCachingManagerWithPolicy()
getSiteManager().registerUtility(cpm, ICachingPolicyManager)
content = DummyContent(id='content')
content.modified_date = mod_time
content = content.__of__(self.app)
script = self._makeOne('testDTML', 'testDTML.dtml')
script = script.__of__(content)
self.REQUEST.environ['IF_MODIFIED_SINCE'
] = '%s;' % rfc1123_date(mod_time + 3600)
data = script(content, self.REQUEST, self.RESPONSE)
self.assertEqual(data, '')
self.assertEqual(self.RESPONSE.getStatus(), 304)
示例2: test_304_response_from_cpm
# 需要导入模块: from Products.CMFCore.tests.base.dummy import DummyContent [as 别名]
# 或者: from Products.CMFCore.tests.base.dummy.DummyContent import modified_date [as 别名]
def test_304_response_from_cpm(self):
# test that we get a 304 response from the cpm via this template
from webdav.common import rfc1123_date
mod_time = DateTime()
self.root.caching_policy_manager = DummyCachingManagerWithPolicy()
content = DummyContent(id="content")
content.modified_date = mod_time
content = content.__of__(self.root)
script = self._makeOne("testDTML", "testDTML.dtml")
script = script.__of__(content)
self.REQUEST.environ["IF_MODIFIED_SINCE"] = "%s;" % rfc1123_date(mod_time + 3600)
data = script(content, self.REQUEST, self.RESPONSE)
self.assertEqual(data, "")
self.assertEqual(self.RESPONSE.getStatus(), 304)