#NEWLINE# def test_charfield_with_choices_raises_error_on_invalid_choice( self ) : #NEWLINE# #INDENT# f = models . CharField ( choices = [ ( 'a' , 'A' ) , ( 'b' , 'B' ) ] ) #NEWLINE# self . assertRaises ( ValidationError , f . clean , 'not a' , None )