Пример #1
0
 def test_url_microblog_context(self):
     self.portal.invokeFactory('Folder', 'f1', title=u"Folder 1")
     f1 = self.portal['f1']
     alsoProvides(f1, IMicroblogContext)
     su = StatusUpdate('foo bar', microblog_context=f1)
     self.assertEqual(su.absolute_url(),
                      '{}/@@post'.format(f1.absolute_url()))
Пример #2
0
 def test_url_content_context(self):
     self.portal.invokeFactory('Folder', 'f1', title=u"Folder 1")
     f1 = self.portal['f1']
     alsoProvides(f1, IMicroblogContext)
     doc = api.content.create(
         container=f1,
         type='Document',
         title='My document',
     )
     su = StatusUpdate('foo bar', content_context=doc)
     self.assertEqual(su.absolute_url(),
                      '{}/view'.format(doc.absolute_url()))
Пример #3
0
 def test_url_no_context(self):
     su = StatusUpdate('foo bar')
     self.assertEqual(su.absolute_url(),
                      '{}/@@post'.format(self.portal.absolute_url()))