Ejemplo n.º 1
0
 def test_adding(self):
     # we can add BaseReview instances
     self.folder.invokeFactory(
         'psj.content.basereview', 'doc1',
         title=u'My Doc', description=u'My description.',
         psj_title=u'My Title', psj_subtitle=u'My Subtitle',
         psj_institute=[u'First Institute Entry'],
         psj_license=u'First License Entry',
         psj_abstract=RICH_TEXT_VALUE1,
         psj_doi=u'My Identifier',
         )
     d1 = self.folder['doc1']
     self.assertTrue(IBaseReview.providedBy(d1))
     self.assertEqual(d1.title, u'My Doc')
     self.assertEqual(d1.description, u'My description.')
     # additional attributes were set
     self.assertEqual(d1.psj_title, u'My Title')
     self.assertEqual(d1.psj_subtitle, u'My Subtitle')
     self.assertEqual(d1.psj_institute, [u'First Institute Entry', ])
     self.assertEqual(d1.psj_license, u'First License Entry')
     self.assertEqual(d1.psj_abstract.output,
                      u'<p>My Richtext Value</p>')
     self.assertEqual(d1.psj_doi, u'My Identifier')
Ejemplo n.º 2
0
 def test_factory(self):
     # our fti provides a factory for BaseReview instances
     fti = queryUtility(IDexterityFTI, name='psj.content.basereview')
     factory = fti.factory
     new_obj = createObject(factory)
     self.assertTrue(IBaseReview.providedBy(new_obj))