def test_user_cannot_modify_instance_in_provisioning_scheduled_state(self):
        self.client.force_authenticate(user=self.user)

        instance = factories.InstanceFactory(state=Instance.States.PROVISIONING_SCHEDULED)
        project = instance.cloud_project_membership.project
        project.add_user(self.user, ProjectRole.ADMINISTRATOR)

        url = factories.InstanceFactory.get_url(instance)

        for action in 'stop', 'start', 'resize':
            response = self.client.post('%s%s/' % (url, action), {})
            self.assertEqual(response.status_code, status.HTTP_409_CONFLICT)

        response = self.client.put(url, {})
        self.assertEqual(response.status_code, status.HTTP_409_CONFLICT)

        response = self.client.patch(url, {})
        self.assertEqual(response.status_code, status.HTTP_409_CONFLICT)

        response = self.client.delete(url)
        self.assertEqual(response.status_code, status.HTTP_409_CONFLICT)
dataset/ETHPy150Open opennode/nodeconductor/nodeconductor/iaas/tests/test_provisioning.py/InstanceApiPermissionTest.test_user_cannot_modify_instance_in_provisioning_scheduled_state/original