def test_to_representation_returns_list_of_strings(self): field = MultipleEnumChoiceField(enum_class=CharTestEnum) result = field.to_representation( [CharTestEnum.FIRST, CharTestEnum.SECOND]) self.assertEqual(['first', 'second'], result)
def test_to_representation_returns_list_of_ints(self): field = MultipleEnumChoiceField(enum_class=IntTestEnum) result = field.to_representation( [IntTestEnum.FIRST, IntTestEnum.SECOND]) self.assertEqual(['1', '2'], result)