def test_columns(self, browser): self.login(self.regular_user, browser) browser.open(self.branch_repofolder) tabbedview.open('Documents') expected_column_data = { '': '', 'Checked out by': '', 'Creation Date': '31.08.2016', 'Delivery Date': '03.01.2010', 'Document Author': 'test_user_1_', 'Document Date': '03.01.2010', 'Dossier': u'Vertr\xe4ge mit der kantonalen Finanzverwaltung', 'File extension': '.docx', 'Keywords': 'Wichtig', 'Modification Date': '31.08.2016', 'Public Trial': 'unchecked', 'Receipt Date': '03.01.2010', 'Reference Number': 'Client1 1.1 / 1 / 14', 'Sequence Number': '14', 'Subdossier': '', 'Title': u'Vertr\xe4gsentwurf', } self.assertEqual( expected_column_data, tabbedview.row_for(self.document).dict(), )
def test_columns(self, browser): self.login(self.regular_user, browser) browser.open(self.branch_repofolder) tabbedview.open('Tasks') expected_column_data = { '': '', 'Date of completion': '', 'Deadline': 'Nov 1, 2016', 'Dossier': u'Vertr\xe4ge mit der kantonalen Finanzverwaltung', 'Issued at': '31.08.2016', 'Issuer': 'Ziegler Robert (robert.ziegler)', 'Organisational Unit': u'Finanz\xe4mt', 'Responsible': u'B\xe4rfuss K\xe4thi (kathi.barfuss)', 'Review state': 'task-state-in-progress', 'Sequence number': '1', 'Subdossier': '', 'Task type': 'For confirmation / correction', 'Title': u'Vertragsentwurf \xdcberpr\xfcfen', } self.assertEqual( expected_column_data, tabbedview.row_for(self.task).dict(), )
def test_create_proposal_visible_when_meeting_feature_enabled( self, browser): self.activate_feature('meeting') self.login(self.manager, browser) browser.open(self.branch_repofolder) tabbedview.open('Documents') self.assertEquals(['Create Proposal'], tabbedview.major_actions().text)
def test_prefix_visible_on_private_folder(self, browser): self.login(self.regular_user, browser) browser.open(self.private_folder) tabbedview.open('Dossiers') urlified_user_id = self.regular_user.id.replace('.', '-') expected_reference_numbers = [ 'P Client1 kathi-barfuss / 1', 'P Client1 kathi-barfuss / 2', ] found_reference_numbers = [ item for item in browser.css('.listing td').text if urlified_user_id in item ] self.assertEqual( len(expected_reference_numbers), len(found_reference_numbers), ) self.assertEqual( sorted(expected_reference_numbers), sorted(found_reference_numbers), )
def test_columns(self, browser): self.login(self.regular_user, browser) browser.open(self.branch_repofolder) tabbedview.open('Proposals') # XXX - Should eventually figure out how to amend the columns helper for this expected_rows = [ ['Decision number', 'Title', 'Description', 'State', 'Comittee', 'Meeting', 'Date of submission', 'Issuer'], ['', u'Vertr\xe4ge', u'F\xfcr weitere Bearbeitung bewilligen', 'Submitted', 'Submitted', u'Rechnungspr\xfcfungskommission', '', '31.08.2016', 'Ziegler Robert (robert.ziegler)'], # noqa ['', u'Antrag f\xfcr Kreiselbau', '', 'Pending', 'Pending', u'Kommission f\xfcr Verkehr', '', '', 'Ziegler Robert (robert.ziegler)'], # noqa ] self.assertEqual(expected_rows, [row.css('td,span').text for row in browser.css('.listing tr')])
def test_visible_actions(self, browser): self.login(self.manager, browser) browser.open(self.branch_repofolder) tabbedview.open('Tasks') expected_actions = [ 'Export selection', 'Move Items', 'Print selection (PDF)', ] self.assertEquals(expected_actions, tabbedview.minor_actions().text) self.assertEquals([], tabbedview.major_actions().text)
def test_dossier_column_linked(self, browser): self.login(self.regular_user, browser) browser.open(self.branch_repofolder) tabbedview.open('Documents') link = tabbedview.cell_for(self.document, 'Dossier').css('a').first self.assertEquals( u'Vertr\xe4ge mit der kantonalen Finanzverwaltung', link.text, ) link.click() self.assertEquals(self.dossier, browser.context)
def test_sharing_info_view_urlencodes_links_with_spaces(self, browser): self.login(self.regular_user, browser) group = create(Builder('group').with_groupid('with spaces')) api.group.grant_roles( group=group, obj=self.dossier, roles=['Publisher']) browser.open(self.dossier) tabbedview.open('Info') group_links = [a.get('href') for a in browser.css('#user-group-sharing-settings tr a')] self.assertEqual( ['http://nohost/plone/@@list_groupmembers?group=fa_users', 'http://nohost/plone/@@list_groupmembers?group=with+spaces'], group_links)
def test_sharing_views(self, browser): """ Test Integration of opengever.sharing """ self.login(self.manager, browser) browser.open(self.dossier) tabbedview.open('Info') expected_users_and_roles = [ 'Logged-in users', 'fa_users', u'B\xe4rfuss K\xe4thi (kathi.barfuss)', u'Fr\xfchling F\xe4ivel (faivel.fruhling)', u'K\xf6nig J\xfcrgen (jurgen.konig)', ] found_users_and_roles = browser.css('#user-group-sharing-settings tr').text self.assertEqual(expected_users_and_roles, found_users_and_roles)
def test_visible_actions(self, browser): # Not all actions of the dossier-tab work on the repositoryfolder-tab. # We are testing as Manager so that we can make sure that actions are # actually removed on this tab. self.login(self.manager, browser) browser.open(self.branch_repofolder) tabbedview.open('Documents') expected_actions = [ 'Copy Items', 'Checkout', 'Cancel', 'Checkin with comment', 'Checkin without comment', 'Export selection', 'Move Items', ] self.assertEquals(expected_actions, tabbedview.minor_actions().text) self.assertEquals([], tabbedview.major_actions().text)
def test_columns(self, browser): self.login(self.regular_user, browser) browser.open(self.branch_repofolder) tabbedview.open('Proposals') # XXX - Should eventually figure out how to amend the columns helper for this expected_rows = [ [ 'Decision number', 'Title', 'Description', 'State', 'Comittee', 'Meeting', 'Date of submission', 'Issuer' ], [ '', u'Vertr\xe4ge', u'F\xfcr weitere Bearbeitung bewilligen', 'Submitted', 'Submitted', u'Rechnungspr\xfcfungskommission', '', '31.08.2016', 'Ziegler Robert (robert.ziegler)' ], # noqa [ '', u'Antrag f\xfcr Kreiselbau', '', 'Pending', 'Pending', u'Kommission f\xfcr Verkehr', '', '', 'Ziegler Robert (robert.ziegler)' ], # noqa ] self.assertEqual( expected_rows, [row.css('td,span').text for row in browser.css('.listing tr')])
def test_create_proposal_visible_when_meeting_feature_enabled(self, browser): self.activate_feature('meeting') self.login(self.manager, browser) browser.open(self.branch_repofolder) tabbedview.open('Documents') self.assertEquals(['Create Proposal'], tabbedview.major_actions().text)
def test_visible_actions(self, browser): self.login(self.regular_user, browser) browser.open(self.branch_repofolder) tabbedview.open('Proposals') self.assertEquals([], tabbedview.minor_actions().text) self.assertEquals([], tabbedview.major_actions().text)