Exemplo n.º 1
0
 def do_post(self, req, data):
     name = req.args.get(Key.NAME)
     scope = req.args.get(Key.SCOPE)
     # These should be in the JSON posted data.
     ticket = int(data.get(Key.TICKET))
     to_pos = int(data.get(Key.TO_POS))
     cmd_move = BacklogController.MoveBacklogItemCommand(self.env,
                                                         name=name,
                                                         scope=scope,
                                                         ticket=ticket,
                                                         to_pos=to_pos)
     return BacklogController(self.env).process_command(cmd_move)
Exemplo n.º 2
0
    def runTest(self):
        first_item = self.backlog[0]
        second_item = self.backlog[1]
        self.tester.go_to_product_backlog()
        tc.find("id=\"ticketID-%s\".*id=\"ticketID-%s\"" %
                (first_item.ticket.id, second_item.ticket.id))

        move_cmd = BacklogController.MoveBacklogItemCommand(
            self.env, name='Product Backlog', ticket=first_item, to_pos=4)
        self.controller.process_command(move_cmd)
        self.tester.go_to_product_backlog()
        tc.find("id=\"ticketID-%s\".*id=\"ticketID-%s\"" %
                (second_item.ticket.id, first_item.ticket.id))
Exemplo n.º 3
0
 def testMoveBacklogItemCommand(self):
     """Test the moving of a backlog item in the backlog"""
     backlog = self.teh.create_backlog('MovingBacklog', num_of_items=20)
     first_item = backlog[0]
     # create a moving command and move the first item to the 5th
     # poistion in the backlog
     fifth_item = backlog[4]
     move_cmd = BacklogController.MoveBacklogItemCommand(
         self.env, name='MovingBacklog', ticket=first_item, to_pos=4)
     self.controller.process_command(move_cmd)
     # we need to reload the backlog from the DB
     get_reload_cmd = BacklogController.GetBacklogCommand(
         self.env, name='MovingBacklog')
     backlog = self.controller.process_command(get_reload_cmd)
     self.assert_equals(backlog[4].ticket, first_item.ticket)
     self.assert_equals(backlog[3].ticket, fifth_item.ticket)
     self.assert_equals(4, backlog[4].pos)
     self.assert_equals(3, backlog[3].pos)
Exemplo n.º 4
0
    def testCanMoveItemsInGlobalBacklogByHandingInTickets(self):
        backlog = self.get(name='Product Backlog', scope=None)
        requirement = self.teh.create_ticket(Type.REQUIREMENT)
        backlog.add(requirement)
        backlog.add(self.teh.create_ticket(Type.REQUIREMENT))
        backlog.add(self.teh.create_ticket(Type.REQUIREMENT))
        backlog.save()

        first_item = backlog[0]
        # cleaning out the cache, because if this where a new request, the cache would be empty and this would throw
        move = BacklogController.MoveBacklogItemCommand(self.env,
                                                        name='Product Backlog',
                                                        ticket=first_item,
                                                        to_pos=2)
        self.controller.process_command(move)
        index = backlog.index(first_item)
        self.assert_equals(2, index)
        self.assert_equals(2, backlog[index].pos)
        self.assert_equals(first_item, backlog[index].ticket)