def test_can_serialize_task_to_dict(self): task = AgiloTicket(self.env, t_type=Type.TASK) self.assertNotEqual('fixed', task[Key.RESOLUTION]) task[Key.SUMMARY] = 'My Summary' task.insert() expected = { # required Key.ID: task.id, Key.TYPE: Type.TASK, Key.SUMMARY: 'My Summary', Key.DESCRIPTION: '', Key.STATUS: '', Key.RESOLUTION: '', Key.REPORTER: '', Key.OWNER: '', # type specific Key.SPRINT: '', Key.REMAINING_TIME: '', Key.RESOURCES: '', # Key.Options is not used in order to reduce required data to # transfer for a backlog load. 'outgoing_links': [], 'incoming_links': [], 'time_of_last_change': to_timestamp(task.time_changed), 'ts': str(task.time_changed), } if AgiloTicketSystem.is_trac_1_0(): from trac.util.datefmt import to_utimestamp expected.update( {'view_time': str(to_utimestamp(task.time_changed))}) self.assert_equals(expected, task.as_dict())
def test_can_serialize_task_to_dict(self): task = AgiloTicket(self.env, t_type=Type.TASK) self.assertNotEqual('fixed', task[Key.RESOLUTION]) task[Key.SUMMARY] = 'My Summary' task.insert() expected = { # required Key.ID: task.id, Key.TYPE: Type.TASK, Key.SUMMARY: 'My Summary', Key.DESCRIPTION: '', Key.STATUS: '', Key.RESOLUTION: '', Key.REPORTER: '', Key.OWNER: '', # type specific Key.SPRINT: '', Key.REMAINING_TIME: '', Key.RESOURCES: '', # Key.Options is not used in order to reduce required data to # transfer for a backlog load. 'outgoing_links': [], 'incoming_links': [], 'time_of_last_change': to_timestamp(task.time_changed), 'ts': str(task.time_changed), } if AgiloTicketSystem.is_trac_1_0(): from trac.util.datefmt import to_utimestamp expected.update({'view_time': str(to_utimestamp(task.time_changed))}) self.assert_equals(expected, task.as_dict())
def runTest(self): """Tests the ticket delete method""" self._tester.login_as(Usernames.admin) ticket_id = self._tester.create_new_agilo_userstory('Delete Me') self._tester.go_to_view_ticket_page(ticket_id) tc.formvalue('propertyform', 'delete', 'click') tc.submit('delete') self._tester.go_to_view_ticket_page(ticket_id, should_fail=True) tc.code(404) from agilo.ticket import AgiloTicketSystem if AgiloTicketSystem.is_trac_1_0(): return else: self._tester._set_ticket_id_sequence(new_value=self._tester.ticketcount)
def runTest(self): """Tests the ticket delete method""" self._tester.login_as(Usernames.admin) ticket_id = self._tester.create_new_agilo_userstory('Delete Me') self._tester.go_to_view_ticket_page(ticket_id) tc.formvalue('propertyform', 'delete', 'click') tc.submit('delete') self._tester.go_to_view_ticket_page(ticket_id, should_fail=True) tc.code(404) from agilo.ticket import AgiloTicketSystem if AgiloTicketSystem.is_trac_1_0(): return else: self._tester._set_ticket_id_sequence( new_value=self._tester.ticketcount)
def runTest(self): # Setting the a default type different from the ticket type to be # created triggered another bug in the preview display... self._tester.login_as(Usernames.admin) self._tester.login_as(Usernames.product_owner) title = 'Foo Bar Title' ticket_id = self._tester.create_new_agilo_userstory(title) self._tester.go_to_view_ticket_page(ticket_id) new_title = 'bulb' tc.formvalue('propertyform', 'summary', new_title) tc.submit('preview') tc.code(200) from agilo.ticket.api import AgiloTicketSystem if AgiloTicketSystem.is_trac_1_0(): tc.find('<span[^>]*>%s</span>' % new_title) else: tc.find('<h2[^>]*>%s</h2>' % new_title)
def runTest(self): # Setting the a default type different from the ticket type to be # created triggered another bug in the preview display... self._tester.login_as(Usernames.admin) self._tester.login_as(Usernames.product_owner) title = 'Foo Bar Title' ticket_id = self._tester.create_new_agilo_userstory(title) self._tester.go_to_view_ticket_page(ticket_id) new_title = 'bulb' tc.formvalue('propertyform', 'summary', new_title) tc.submit('preview') tc.code(200) from agilo.ticket.api import AgiloTicketSystem if AgiloTicketSystem.is_trac_1_0(): tc.find('<span[^>]*>%s</span>' % new_title) else: tc.find('<h2[^>]*>%s</h2>' % new_title)