#NEWLINE# def test_can_initiate_deletion_of_instance_with_connected_backup_schedule( self ) : #NEWLINE# #INDENT# instance = factories . InstanceFactory ( state = Instance . States . OFFLINE ) #NEWLINE# BackupSchedule . objects . create ( backup_source = instance , schedule = '* * * * *' , retention_time = 1 , maximal_number_of_backups = 2 ) #NEWLINE# self . client . force_authenticate ( structure_factories . UserFactory ( is_staff = True ) ) #NEWLINE# response = self . client . delete ( factories . InstanceFactory . get_url ( self ) ) #NEWLINE# self . assertEqual ( response . status_code , status . HTTP_202_ACCEPTED , response . data )