Exemplo n.º 1
0
 def afterSetUp(self):
     addNyFolder(self.portal,
                 'myfolder',
                 contributor='contributor',
                 submitted=1)
     start_date = (date.today() - timedelta(days=1)).strftime('%d/%m/%Y')
     end_date = (date.today() + timedelta(days=10)).strftime('%d/%m/%Y')
     addNyTalkBackConsultation(self.portal.myfolder,
                               title="Test consultation",
                               start_date=start_date,
                               end_date=end_date,
                               contributor='contributor',
                               submitted=1)
     section_data = {
         'id':
         'test-section',
         'title':
         'Test section',
         'body': ('<p>First paragraph</p>'
                  '<p>Second paragraph</p>'
                  '<p>Third paragraph</p>'),
     }
     self.consultation = self.portal.myfolder['test-consultation']
     self.consultation._Naaya___Review_TalkBack_Consultation_Permission = [
         'Contributor'
     ]
     self.consultation.addSection(**section_data)
     transaction.commit()
     self.section = self.consultation['test-section']
     self.section_url = 'http://localhost/portal/myfolder/test-consultation/test-section'
 def afterSetUp(self):
     self.portal.manage_install_pluggableitem('Naaya TalkBack Consultation')
     addNyFolder(self.portal, 'myfolder', contributor='contributor', submitted=1)
     start_date = (date.today() - timedelta(days=1)).strftime('%d/%m/%Y')
     end_date = (date.today() + timedelta(days=10)).strftime('%d/%m/%Y')
     addNyTalkBackConsultation(self.portal.myfolder, title="Test consultation",
         start_date=start_date, end_date=end_date,
         contributor='contributor', submitted=1)
     transaction.commit()
Exemplo n.º 3
0
 def afterSetUp(self):
     addNyFolder(self.portal, 'myfolder', contributor='admin', submitted=1)
     start_date = (date.today() - timedelta(days=1)).strftime('%d/%m/%Y')
     end_date = (date.today() + timedelta(days=10)).strftime('%d/%m/%Y')
     addNyTalkBackConsultation(self.portal.myfolder, title="Test consultation",
         start_date=start_date, end_date=end_date,
         contributor='admin', submitted=1)
     transaction.commit()
     self.consultation = self.portal.myfolder['test-consultation']
     self.diverted_mail = divert_mail()
     self.cons_url = 'http://localhost/portal/myfolder/test-consultation'
Exemplo n.º 4
0
    def afterSetUp(self):
        addNyFolder(self.portal, 'myfolder', contributor='admin', submitted=1)
        start_date = (date.today() - timedelta(days=1)).strftime('%d/%m/%Y')
        end_date = (date.today() + timedelta(days=10)).strftime('%d/%m/%Y')
        addNyTalkBackConsultation(self.portal.myfolder,
                                  title="Test consultation",
                                  start_date=start_date,
                                  end_date=end_date,
                                  contributor='admin',
                                  submitted=1)
        consultation = self.portal.myfolder['test-consultation']

        consultation.addSection(
            id='test-section',
            title='Test section',
            body='<p>First paragraph</p><p>Second paragraph</p>')

        consultation.invitations._send_invitation(
            name='The Invitee',
            email='*****@*****.**',
            organization='Thinkle University',
            notes='Knows his shit',
            inviter_userid='contributor',
            inviter_name='Contributor Test',
            message='')
        self.invite_key = consultation.invitations._invites.values()[0].key

        permattr = '_Naaya___Invite_to_TalkBack_Consultation_Permission'
        setattr(consultation, permattr, ['Reviewer'])

        comments = []
        paragraph_000 = consultation['test-section']['000']
        # comment 0
        id0 = addComment(paragraph_000,
                         contributor='contributor',
                         message=u'comment by contributor (0)')
        comments.append(paragraph_000[id0])

        # comment 1
        id1 = addComment(consultation['test-section']['000'],
                         contributor='invite:' + self.invite_key,
                         message=u'invitee comment (1)')
        comments.append(paragraph_000[id1])

        transaction.commit()

        self.comments = comments
        self.consultation = self.portal.myfolder['test-consultation']
        self.diverted_mail = divert_mail()
        self.cons_url = 'http://localhost/portal/myfolder/test-consultation'
Exemplo n.º 5
0
 def afterSetUp(self):
     self.portal.manage_install_pluggableitem('Naaya TalkBack Consultation')
     addNyFolder(self.portal,
                 'myfolder',
                 contributor='contributor',
                 submitted=1)
     start_date = (date.today() - timedelta(days=1)).strftime('%d/%m/%Y')
     end_date = (date.today() + timedelta(days=10)).strftime('%d/%m/%Y')
     addNyTalkBackConsultation(self.portal.myfolder,
                               title="Test consultation",
                               start_date=start_date,
                               end_date=end_date,
                               contributor='contributor',
                               submitted=1)
     transaction.commit()
Exemplo n.º 6
0
    def afterSetUp(self):
        addNyFolder(self.portal, 'myfolder', contributor='admin', submitted=1)
        start_date = (date.today() - timedelta(days=1)).strftime('%d/%m/%Y')
        end_date = (date.today() + timedelta(days=10)).strftime('%d/%m/%Y')
        addNyTalkBackConsultation(self.portal.myfolder, title="Test consultation",
            start_date=start_date, end_date=end_date,
            contributor='admin', submitted=1)
        consultation = self.portal.myfolder['test-consultation']

        consultation.addSection(
            id='test-section', title='Test section',
            body='<p>First paragraph</p><p>Second paragraph</p>')

        consultation.invitations._send_invitation(
            name='The Invitee', email='*****@*****.**',
            organization='Thinkle University', notes='Knows his shit',
            inviter_userid='contributor', inviter_name='Contributor Test', message='')
        self.invite_key = consultation.invitations._invites.values()[0].key

        permattr = '_Naaya___Invite_to_TalkBack_Consultation_Permission'
        setattr(consultation, permattr, ['Reviewer'])

        comments = []
        paragraph_000 = consultation['test-section']['000']
        # comment 0
        id0 = addComment(paragraph_000,
                         contributor='contributor',
                         message=u'comment by contributor (0)')
        comments.append(paragraph_000[id0])

        # comment 1
        id1 = addComment(consultation['test-section']['000'],
                         contributor='invite:' + self.invite_key,
                         message=u'invitee comment (1)')
        comments.append(paragraph_000[id1])

        transaction.commit()

        self.comments = comments
        self.consultation = self.portal.myfolder['test-consultation']
        self.diverted_mail = divert_mail()
        self.cons_url = 'http://localhost/portal/myfolder/test-consultation'
 def afterSetUp(self):
     addNyFolder(self.portal, 'myfolder', contributor='contributor', submitted=1)
     start_date = (date.today() - timedelta(days=1)).strftime('%d/%m/%Y')
     end_date = (date.today() + timedelta(days=10)).strftime('%d/%m/%Y')
     addNyTalkBackConsultation(self.portal.myfolder, title="Test consultation",
         start_date=start_date, end_date=end_date,
         contributor='contributor', submitted=1)
     section_data = {
         'id': 'test-section',
         'title': 'Test section',
         'body': (
             '<p>First paragraph</p>'
             '<p>Second paragraph</p>'
             '<p>Third paragraph</p>'),
     }
     self.consultation = self.portal.myfolder['test-consultation']
     self.consultation._Naaya___Review_TalkBack_Consultation_Permission = ['Contributor']
     self.consultation.addSection(**section_data)
     transaction.commit()
     self.section = self.consultation['test-section']
     self.section_url = 'http://localhost/portal/myfolder/test-consultation/test-section'
Exemplo n.º 8
0
    def afterSetUp(self):
        addNyFolder(self.portal, 'myfolder', contributor='admin', submitted=1)
        start_date = (date.today() - timedelta(days=1)).strftime('%d/%m/%Y')
        end_date = (date.today() + timedelta(days=10)).strftime('%d/%m/%Y')
        addNyTalkBackConsultation(self.portal.myfolder, title="Test consultation",
            start_date=start_date, end_date=end_date,
            contributor='admin', submitted=1)
        consultation = self.portal.myfolder['test-consultation']
        consultation.invitations._send_invitation(
            name='The Invitee', email='*****@*****.**',
            organization='Thinkle University', notes='Knows his shit',
            inviter_userid='contributor', inviter_name='Contributor Test', message='')
        consultation.addSection(
            id='test-section', title='Test section',
            body='<p>First paragraph</p><p>Second paragraph</p>')
        transaction.commit()

        self.consultation = self.portal.myfolder['test-consultation']
        self.invite_key = self.consultation.invitations._invites.values()[0].key
        self.diverted_mail = divert_mail()
        self.cons_url = 'http://localhost/portal/myfolder/test-consultation'
    def test_main(self):
        """ Add, Edit and Delete Naaya TalkBack Consultation """
        #add NyConsultation
        addNyTalkBackConsultation(self.test_folder,
                                id='sc1',
                                title='sc1',
                                lang='en')

        addNyTalkBackConsultation(self.test_folder,
                                id='sc1_fr',
                                title='sc1_fr',
                                lang='fr')

        meta = self.test_folder.objectValues(['Naaya TalkBack Consultation'])

        #get added Consultation
        for x in meta:
            if x.getLocalProperty('title', 'en') == 'sc1':
                meta = x
            if x.getLocalProperty('title', 'fr') == 'sc1_fr':
                meta_fr = x

        self.assertEqual(meta.getLocalProperty('title', 'en'), 'sc1')
        self.assertEqual(meta_fr.getLocalProperty('title', 'fr'), 'sc1_fr')

        #change Consultation title
        meta.saveProperties(title='sc1_edited', lang='en')
        meta_fr.saveProperties(title='sc1_fr_edited', lang='fr')

        self.assertEqual(meta.getLocalProperty('title', 'en'),
                         'sc1_edited')

        self.assertEqual(meta_fr.getLocalProperty('title', 'fr'),
                         'sc1_fr_edited')

        #delete Consultation
        self.test_folder.manage_delObjects([meta.getId(), meta_fr.getId()])

        meta = self.test_folder.objectValues(['Naaya TalkBack Consultation'])
        self.assertEqual(meta, [])
Exemplo n.º 10
0
    def test_main(self):
        """ Add, Edit and Delete Naaya TalkBack Consultation """
        #add NyConsultation
        addNyTalkBackConsultation(self.test_folder,
                                  id='sc1',
                                  title='sc1',
                                  lang='en')

        addNyTalkBackConsultation(self.test_folder,
                                  id='sc1_fr',
                                  title='sc1_fr',
                                  lang='fr')

        meta = self.test_folder.objectValues(['Naaya TalkBack Consultation'])

        #get added Consultation
        for x in meta:
            if x.getLocalProperty('title', 'en') == 'sc1':
                meta = x
            if x.getLocalProperty('title', 'fr') == 'sc1_fr':
                meta_fr = x

        self.assertEqual(meta.getLocalProperty('title', 'en'), 'sc1')
        self.assertEqual(meta_fr.getLocalProperty('title', 'fr'), 'sc1_fr')

        #change Consultation title
        meta.saveProperties(title='sc1_edited', lang='en')
        meta_fr.saveProperties(title='sc1_fr_edited', lang='fr')

        self.assertEqual(meta.getLocalProperty('title', 'en'), 'sc1_edited')

        self.assertEqual(meta_fr.getLocalProperty('title', 'fr'),
                         'sc1_fr_edited')

        #delete Consultation
        self.test_folder.manage_delObjects([meta.getId(), meta_fr.getId()])

        meta = self.test_folder.objectValues(['Naaya TalkBack Consultation'])
        self.assertEqual(meta, [])
Exemplo n.º 11
0
    def setUp(self):
        super(CommentsFeedTest, self).setUp()
        addNyFolder(self.portal, 'myfolder', contributor='admin', submitted=1)
        myfolder = self.portal['myfolder']

        start_date = (date.today() - timedelta(days=1)).strftime('%d/%m/%Y')
        end_date = (date.today() + timedelta(days=10)).strftime('%d/%m/%Y')

        tb_id = addNyTalkBackConsultation(myfolder,
                title="Test consultation", contributor='admin', submitted=1,
                start_date=start_date, end_date=end_date)
        self.tb = myfolder[tb_id]

        self.tb.addSection(title="Sec", body="<p>para 1</p><p>para 2</p>")
        self.tb_url = 'http://nohost/portal/myfolder/test-consultation'