Ejemplo n.º 1
0
    def test_failure_to_notify_does_not_result_in_error(self):
        t2 = self._insert_ticket(self.env, "Bar")
        self.req.args['add'] = True
        self.req.args['dest_tid'] = str(t2)
        self.req.args['reltype'] = DEPENDS_ON
        rlm = RelationManagementModule(self.env)
        rlm.notify_relation_changed = self._failing_notification

        rlm.process_request(self.req)
        self.assertEqual(len(self.req.chrome['warnings']), 1)
Ejemplo n.º 2
0
    def test_failure_to_notify_does_not_result_in_error(self):
        t2 = self._insert_ticket(self.env, "Bar")
        self.req.args['add'] = True
        self.req.args['dest_tid'] = str(t2)
        self.req.args['reltype'] = DEPENDS_ON
        rlm = RelationManagementModule(self.env)
        rlm.notify_relation_changed = self._failing_notification

        url, data, x = rlm.process_request(self.req)
        self.assertEqual(len(self.req.chrome['warnings']), 1)
Ejemplo n.º 3
0
    def process_request(self):
        ticket_module = TicketModule(self.env)

        ticket_module.match_request(self.req)
        template, data, content_type = ticket_module.process_request(self.req)
        template, data, content_type = \
            RelationManagementModule(self.env).post_process_request(
                self.req, template, data, content_type)
        return data
Ejemplo n.º 4
0
    def render_widget(self, name, context, options):
        """Gather list of relations and render data in compact view
        """
        req = context.req
        title = _('Related tickets')
        params = ('tid', 'max')
        tid, max_ = self.bind_params(name, options, *params)

        ticket = Ticket(self.env, tid)
        data = {
            'ticket': ticket,
            'relations': \
                RelationManagementModule(self.env).get_ticket_relations(ticket),
        }
        return 'widget_relations.html', \
            {'title': title, 'data': data, }, context
Ejemplo n.º 5
0
 def test_post_process_request_can_handle_none_data(self):
     self.req.path_info = '/source'
     RelationManagementModule(self.env).post_process_request(self.req, '',
                                                             None, '')
Ejemplo n.º 6
0
 def process_request(self):
     url, data, x = RelationManagementModule(self.env).process_request(
         self.req)
     return data