#NEWLINE# def test_non_existant_setting( self ) : #NEWLINE# #INDENT# form = SettingsForm ( ) #NEWLINE# bad_setting = 'doesnt_exist' #NEWLINE# assert ( bad_setting not in form . fields . keys ( ) ) #NEWLINE# with self . assertRaises ( KeyError ) : #NEWLINE# #INDENT# Setting . get_for_user ( self . u , bad_setting )