Example #1
0
 def test_safe_custom_fields(self):
     """Tests that the defined custom fields are safe"""
     ticket_custom = \
         AgiloConfig(self.env).get_section(AgiloConfig.TICKET_CUSTOM)
     custom_fields = ticket_custom.get_options_matching_re('^[^.]+$')
     tfw = FieldsWrapper(self.env, 
                         AgiloTicketSystem(self.env).get_ticket_fields(), 
                         Type.TASK)
     for f in tfw:
         if f[Key.NAME] in custom_fields:
             self.assert_true(f[Key.CUSTOM], 
                             "%s should be custom!!!" % f[Key.NAME])
 def _get_number_of_custom_fields(self):
     env = self._testenv.get_trac_environment()
     config = AgiloConfig(env).get_section(AgiloConfig.TICKET_CUSTOM)
     last = len(config.get_options_matching_re('^[^.]+$')) - 1
     return last