def test_get_prep_value(self): f = ChoiceEnumField(enum_type=MyChoices) self.assertEqual(f.get_prep_value(MyChoices.A), 0) self.assertEqual(f.get_prep_value(MyChoices.B), 1) with self.assertRaises(ValueError): f.get_prep_value('X')
def test_get_prep_value(): f = ChoiceEnumField(enum_type=MyChoices) assert f.get_prep_value(MyChoices.A) is 0 assert f.get_prep_value(MyChoices.B) is 1
def test_get_prep_value(self): f = ChoiceEnumField(enum_type=MyChoices) self.assertEqual(f.get_prep_value(MyChoices.A), 0) self.assertEqual(f.get_prep_value(MyChoices.B), 1)