from django.test import TestCase from accounts.models import IntegerChoicesField class IntegerChoicesFieldTestCase(TestCase): def test_from_db_value(self): val = IntegerChoicesField().from_db_value(None, None, None) self.assertIsNone(val) def test_to_python(self): val = IntegerChoicesField().to_python(None) self.assertIsNone(val)