@@ -673,12 +673,20 @@ def test_CharField(self):
673673 self .assertIsInstance (
674674 CharField ().get_prep_value (lazy_func ()),
675675 six .text_type )
676+ lazy_func = lazy (lambda : 0 , int )
677+ self .assertIsInstance (
678+ CharField ().get_prep_value (lazy_func ()),
679+ six .text_type )
676680
677681 def test_CommaSeparatedIntegerField (self ):
678682 lazy_func = lazy (lambda : '1,2' , six .text_type )
679683 self .assertIsInstance (
680684 CommaSeparatedIntegerField ().get_prep_value (lazy_func ()),
681685 six .text_type )
686+ lazy_func = lazy (lambda : 0 , int )
687+ self .assertIsInstance (
688+ CommaSeparatedIntegerField ().get_prep_value (lazy_func ()),
689+ six .text_type )
682690
683691 def test_DateField (self ):
684692 lazy_func = lazy (lambda : datetime .date .today (), datetime .date )
@@ -709,12 +717,20 @@ def test_FileField(self):
709717 self .assertIsInstance (
710718 FileField ().get_prep_value (lazy_func ()),
711719 six .text_type )
720+ lazy_func = lazy (lambda : 0 , int )
721+ self .assertIsInstance (
722+ FileField ().get_prep_value (lazy_func ()),
723+ six .text_type )
712724
713725 def test_FilePathField (self ):
714726 lazy_func = lazy (lambda : 'tests.py' , six .text_type )
715727 self .assertIsInstance (
716728 FilePathField ().get_prep_value (lazy_func ()),
717729 six .text_type )
730+ lazy_func = lazy (lambda : 0 , int )
731+ self .assertIsInstance (
732+ FilePathField ().get_prep_value (lazy_func ()),
733+ six .text_type )
718734
719735 def test_FloatField (self ):
720736 lazy_func = lazy (lambda : 1.2 , float )
@@ -735,9 +751,13 @@ def test_IntegerField(self):
735751 int )
736752
737753 def test_IPAddressField (self ):
738- lazy_func = lazy (lambda : '127.0.0.1' , six .text_type )
739754 with warnings .catch_warnings (record = True ):
740755 warnings .simplefilter ("always" )
756+ lazy_func = lazy (lambda : '127.0.0.1' , six .text_type )
757+ self .assertIsInstance (
758+ IPAddressField ().get_prep_value (lazy_func ()),
759+ six .text_type )
760+ lazy_func = lazy (lambda : 0 , int )
741761 self .assertIsInstance (
742762 IPAddressField ().get_prep_value (lazy_func ()),
743763 six .text_type )
@@ -747,6 +767,10 @@ def test_GenericIPAddressField(self):
747767 self .assertIsInstance (
748768 GenericIPAddressField ().get_prep_value (lazy_func ()),
749769 six .text_type )
770+ lazy_func = lazy (lambda : 0 , int )
771+ self .assertIsInstance (
772+ GenericIPAddressField ().get_prep_value (lazy_func ()),
773+ six .text_type )
750774
751775 def test_NullBooleanField (self ):
752776 lazy_func = lazy (lambda : True , bool )
@@ -771,6 +795,10 @@ def test_SlugField(self):
771795 self .assertIsInstance (
772796 SlugField ().get_prep_value (lazy_func ()),
773797 six .text_type )
798+ lazy_func = lazy (lambda : 0 , int )
799+ self .assertIsInstance (
800+ SlugField ().get_prep_value (lazy_func ()),
801+ six .text_type )
774802
775803 def test_SmallIntegerField (self ):
776804 lazy_func = lazy (lambda : 1 , int )
@@ -783,6 +811,10 @@ def test_TextField(self):
783811 self .assertIsInstance (
784812 TextField ().get_prep_value (lazy_func ()),
785813 six .text_type )
814+ lazy_func = lazy (lambda : 0 , int )
815+ self .assertIsInstance (
816+ TextField ().get_prep_value (lazy_func ()),
817+ six .text_type )
786818
787819 def test_TimeField (self ):
788820 lazy_func = lazy (lambda : datetime .datetime .now ().time (), datetime .time )
0 commit comments