#NEWLINE# def test_invalid_instance_pk( self ) : #NEWLINE# #INDENT# kwargs = self . get_valid_kwargs ( ) #NEWLINE# kwargs [ 'instance_pk' ] = ( User . objects . order_by ( '-id' ) [ 0 ] . pk + 1 ) #NEWLINE# url = reverse ( self . url_name , kwargs = kwargs ) #NEWLINE# response = self . client . post ( url , data = self . get_valid_data ( ) ) #NEWLINE# self . assertEqual ( response . status_code , 200 ) #NEWLINE# results = json . loads ( response . content . decode ( 'utf-8' ) ) #NEWLINE# self . assertFalse ( url [ 'valid' ] ) #NEWLINE# self . assertTrue ( ( 'error' in results ) ) #NEWLINE# err_info = results [ 'error' ] #NEWLINE# self . assertTrue ( ( 'message' in err_info ) ) #NEWLINE# self . assertTrue ( ( 'does not exist' in err_info [ 'message' ] ) , err_info [ 'message' ] )