示例#1
0
 def test_create_ticket_command(self):
     """Tests the create ticket command"""
     cmd_create = TicketController.CreateTicketCommand(
         self.env, summary='This is a ticket')
     t = self.controller.process_command(cmd_create)
     self.assert_true(t.exists)
     self.assert_equals('This is a ticket', t[Key.SUMMARY])
示例#2
0
 def test_save_ticket_command(self):
     """Tests the save ticket command"""
     cmd_create = TicketController.CreateTicketCommand(
         self.env, summary='This is a ticket')
     t = self.controller.process_command(cmd_create)
     self.assert_true(t.exists)
     self.assert_equals('This is a ticket', t[Key.SUMMARY])
     cmd_save = TicketController.SaveTicketCommand(
         self.env, ticket=t.id, properties={Key.DESCRIPTION: 'Hey!'})
     self.controller.process_command(cmd_save)
     # Now verify that the ticket has really been saved
     self.controller.manager.get_cache().invalidate()
     cmd_get = TicketController.GetTicketCommand(self.env, ticket=t.id)
     t_reloaded = self.controller.process_command(cmd_get)
     self.assert_not_none(t_reloaded)
     self.assert_equals('Hey!', t_reloaded[Key.DESCRIPTION])