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): 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 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) transaction.commit()
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'
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'
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) transaction.commit()
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 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 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, [])
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, [])