#NEWLINE# def test_convert_by_lookup_error( self ) : #NEWLINE# #INDENT# 'Establish that if doing a foriegn key lookup fails, that we\n        raise an appropriate exception.\n        ' #NEWLINE# p = click . Option ( ( 'name' , '-n' ) ) #NEWLINE# with client . test_mode as t : #NEWLINE# #INDENT# t . register_json ( '/users/?username=meagan' , { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } , status_code = 404 ) #NEWLINE# with self . assertRaises ( exc . RelatedError ) : #NEWLINE# #INDENT# self . related . convert ( 'meagan' , t , None )