#NEWLINE# def test_foreign_key_validation( self ) : #NEWLINE# #INDENT# def declare_bad( val ) : #NEWLINE# #INDENT# class Bad ( TestModel ) : #NEWLINE# #INDENT# name = ForeignKeyField ( val ) #NEWLINE# #UNINDENT# #UNINDENT# vals_to_try = [ ForeignKeyField ( User ) , 'Self' , object , object ( ) ] #NEWLINE# for val in vals_to_try : #NEWLINE# #INDENT# self . assertRaises ( TypeError , declare_bad , val )