Пример #1
0
 def test_choice_disable_non_ready(self):
     choice = fields.Choice('test_title', True)
     self.assertEqual({}, fields._disable_non_ready(choice))
     choice = fields.Choice('test_title', False)
     self.assertEqual({'disabled': 'disabled'},
                      fields._disable_non_ready(choice))
Пример #2
0
 def test_choice_get_title(self):
     choice = fields.Choice('test_title', True)
     self.assertEqual('test_title', fields._get_title(choice))
     self.assertIsNone(fields._get_title(None))