示例#1
0
 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')
示例#2
0
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
示例#3
0
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
示例#4
0
 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)
示例#5
0
 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')