Exemple #1
0
 def test_from_db_value(self):
     f = ChoiceEnumField(enum_type=MyChoices)
     self.assertEqual(f.from_db_value(0, None, None, None), MyChoices.A)
     self.assertEqual(f.from_db_value(1, None, None, None), MyChoices.B)
     self.assertEqual(f.from_db_value(2, None, None, None), 2)
Exemple #2
0
 def test_from_db_value(self):
     f = ChoiceEnumField(enum_type=MyChoices)
     self.assertEqual(f.from_db_value(0, None, None, None), MyChoices.A)
     self.assertEqual(f.from_db_value(1, None, None, None), MyChoices.B)
     self.assertEqual(f.from_db_value(2, None, None, None), 2)
Exemple #3
0
def test_from_db_value():
    f = ChoiceEnumField(enum_type=MyChoices)
    assert f.from_db_value(0, None, None, None) is MyChoices.A
    assert f.from_db_value(1, None, None, None) is MyChoices.B
    assert f.from_db_value(2, None, None, None) is 2
Exemple #4
0
def test_from_db_value():
    f = ChoiceEnumField(enum_type=MyChoices)
    assert f.from_db_value(0, None, None, None) is MyChoices.A
    assert f.from_db_value(1, None, None, None) is MyChoices.B
    assert f.from_db_value(2, None, None, None) is 2