def test_ticket_type_set_successful(self):
        """
        When we add custom ticket_type enum values to the config
        and call TicketFieldConfigCommand.set_fields_from_config()
        we expect the Trac environments ticket_type enums to be updated with our
        custom values and removal of the default values.
        """
        # We create an instance of the panel so we can check existing values
        panel = TicketTypeAdminPanel(self.env)

        # Check the environment initially contains the default values.
        self.assertItemsEqual(panel.get_enum_list(), self.default['ticket_type'])

        # create the section, option, and values in configuration
        self.env.config.set('ticket-field-config', 'ticket_type',
                            ','.join(self.new['ticket_type']))

        admin_command = TicketFieldConfigCommand(self.env)

        # run our plugin
        admin_command.set_fields_from_config()

        self.assertItemsEqual(panel.get_enum_list(), self.new['ticket_type'])
Esempio n. 2
0
 def setUp(self):
     super(TicketTypeAdminPanelTestCase, self).setUp()
     self.admin = TicketTypeAdminPanel(self.env)
Esempio n. 3
0
 def test_remove_default_type(self):
     ap = TicketTypeAdminPanel(self.env)
     self._test_remove_default(ap, 'task')
Esempio n. 4
0
 def test_add_type(self):
     ap = TicketTypeAdminPanel(self.env)
     self._test_add(ap, 'improvement')
 def list_ticket_type_in_json(self):
     panel = TicketTypeAdminPanel(self.env)
     printout(json.dumps(panel.get_enum_list()))
Esempio n. 6
0
 def setUp(self):
     super().setUp()
     self.admin = TicketTypeAdminPanel(self.env)