def test_priority_set_successful(self):
        """
        When we add custom priority enum values to the config
        and call TicketFieldConfigCommand.set_fields_from_config()
        we expect the Trac environments priority 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 = PriorityAdminPanel(self.env)

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

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

        admin_command = TicketFieldConfigCommand(self.env)

        # run our plugin
        admin_command.set_fields_from_config()

        self.assertItemsEqual(panel.get_enum_list(), self.new['priority'])
Beispiel #2
0
 def setUp(self):
     super(PriorityAdminPanelTestCase, self).setUp()
     self.admin = PriorityAdminPanel(self.env)
Beispiel #3
0
 def test_remove_default_priority(self):
     ap = PriorityAdminPanel(self.env)
     self._test_remove_default(ap, 'critical')
Beispiel #4
0
 def test_add_priority(self):
     ap = PriorityAdminPanel(self.env)
     self._test_add(ap, 'priority 1')
 def list_priority_in_json(self):
     panel = PriorityAdminPanel(self.env)
     printout(json.dumps(panel.get_enum_list()))
Beispiel #6
0
 def setUp(self):
     super().setUp()
     self.admin = PriorityAdminPanel(self.env)