#NEWLINE# def test_user_cannot_assign_not_existing_ip_to_the_instance( self ) : #NEWLINE# #INDENT# class InvalidFloatingIP ( object ) : #NEWLINE# #INDENT# uuid = uuid4 ( ) #NEWLINE# #UNINDENT# invalid_floating_ip = InvalidFloatingIP ( ) #NEWLINE# instance = factories . InstanceFactory ( state = Instance . States . OFFLINE ) #NEWLINE# with self . get_task ( ) as mocked_task : #NEWLINE# #INDENT# response = self . get_response ( instance , invalid_floating_ip ) #NEWLINE# self . assertEqual ( response . status_code , status . HTTP_400_BAD_REQUEST ) #NEWLINE# self . assertEqual ( response . data [ 'floating_ip' ] , [ 'Invalid hyperlink - Object does not exist.' ] ) #NEWLINE# self . assertFalse ( mocked_task . called )