#NEWLINE# def test_user_cannot_change_customer_of_service_he_owns( self ) : #NEWLINE# #INDENT# user = self . users [ 'customer_owner' ] #NEWLINE# self . client . force_authenticate ( user = user ) #NEWLINE# service = self . services [ 'owned' ] #NEWLINE# new_customer = structure_factories . CustomerFactory ( ) #NEWLINE# new_customer . add_user ( user , CustomerRole . OWNER ) #NEWLINE# payload = { #NEWLINE# #INDENT# 'customer' : structure_factories . CustomerFactory . get_url ( new_customer ) , #NEWLINE# #UNINDENT# } #NEWLINE# response = self . client . patch ( factories . OpenStackServiceFactory . get_url ( service ) , data = payload ) #NEWLINE# self . assertEqual ( response . status_code , status . HTTP_200_OK ) #NEWLINE# reread_service = models . OpenStackService . objects . get ( pk = service . pk ) #NEWLINE# self . assertEqual ( reread_service . customer , service . customer )