本文整理匯總了Python中Products.CMFDefault.Document.Document.editMetadata方法的典型用法代碼示例。如果您正苦於以下問題:Python Document.editMetadata方法的具體用法?Python Document.editMetadata怎麽用?Python Document.editMetadata使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Products.CMFDefault.Document.Document
的用法示例。
在下文中一共展示了Document.editMetadata方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: test_STX_NoHeaders_but_colon
# 需要導入模塊: from Products.CMFDefault.Document import Document [as 別名]
# 或者: from Products.CMFDefault.Document.Document import editMetadata [as 別名]
def test_STX_NoHeaders_but_colon( self ):
d = Document('foo')
d.editMetadata( title="Plain STX"
, description="Look, Ma, no headers!"
, subject=( "plain", "STX" )
)
d.edit(text_format='structured-text', text=STX_NO_HEADERS_BUT_COLON)
self.assertEqual( d.EditableBody(), STX_NO_HEADERS_BUT_COLON )
示例2: test_STX_NoHeaders
# 需要導入模塊: from Products.CMFDefault.Document import Document [as 別名]
# 或者: from Products.CMFDefault.Document.Document import editMetadata [as 別名]
def test_STX_NoHeaders( self ):
REQUEST=fakeRequest()
REQUEST['BODY']=STX_NO_HEADERS
d = Document('foo')
d.editMetadata( title="Plain STX"
, description="Look, Ma, no headers!"
, subject=( "plain", "STX" )
)
self.assertEqual( d.Format(), 'text/html' )
self.assertEqual( d.Title(), 'Plain STX' )
self.assertEqual( d.Description(), 'Look, Ma, no headers!' )
self.assertEqual( len( d.Subject() ), 2 )
self.failUnless( 'plain' in d.Subject() )
self.failUnless( 'STX' in d.Subject() )
d.PUT(REQUEST, RESPONSE=fakeResponse())
self.assertEqual( d.Format(), 'text/plain' )
self.assertEqual( d.Title(), 'Plain STX' )
self.assertEqual( d.Description(), 'Look, Ma, no headers!' )
self.assertEqual( len( d.Subject() ), 2 )
self.failUnless( 'plain' in d.Subject() )
self.failUnless( 'STX' in d.Subject() )
示例3: test_STX_NoHeaders
# 需要導入模塊: from Products.CMFDefault.Document import Document [as 別名]
# 或者: from Products.CMFDefault.Document.Document import editMetadata [as 別名]
def test_STX_NoHeaders( self ):
REQUEST=fakeRequest()
REQUEST['BODY']=STX_NO_HEADERS
d = Document('foo')
d.editMetadata( title="Plain STX"
, description="Look, Ma, no headers!"
, subject=( "plain", "STX" )
)
assert d.Format() == 'text/html'
assert d.Title() == 'Plain STX'
assert d.Description() == 'Look, Ma, no headers!'
assert len( d.Subject() ) == 2
assert 'plain' in d.Subject()
assert 'STX' in d.Subject()
d.PUT(REQUEST, RESPONSE=fakeResponse())
assert d.Format() == 'text/plain'
assert d.Title() == 'Plain STX'
assert d.Description() == 'Look, Ma, no headers!'
assert len( d.Subject() ) == 2
assert 'plain' in d.Subject()
assert 'STX' in d.Subject()