def test_project_creation_and_removal(self):

        with P4Connection(self.P4HOST, self.P4PORT, self.P4USER) as p4:
            project = None
            try:
                project = create_new_project(self.PROJECT_NAME)
                delete_project(project)
                project = None
            except:
                if project:
                    delete_project(project)
                raise
    def test_project_creation_and_removal(self):

        with P4ConnectionAsUnitTestUser() as p4:
            project = None
            try:
                project = create_new_project(self.PROJECT_NAME)
                delete_project(project)
                project = None
            except:
                if project:
                    delete_project(project)
                raise
    def test_add_and_remove_user(self):

        with P4Connection(self.P4HOST, self.P4PORT, self.P4USER) as p4:
            project = None
            project_access = None
            try:
                project = create_new_project(self.PROJECT_NAME)
                project_access = add_user_to_project(project, self.user)
                remove_user_from_project(project_access)
            except:
                if project_access:
                    remove_user_from_project(project_access)
                if project:
                    delete_project(project)
                raise
    def test_add_and_remove_user(self):

        with P4ConnectionAsUnitTestUser() as p4:
            project = None
            project_access = None
            try:
                project = create_new_project(self.PROJECT_NAME)
                project_access = add_user_to_project(project, self.user)
                remove_user_from_project(project_access)
                project_access = None
                delete_project(project)
                project = None
            except:
                if project_access:
                    remove_user_from_project(project_access)
                if project:
                    delete_project(project)
                raise
Esempio n. 5
0
def delete_project(request, id):

    from project_actions import delete_project
    delete_project(PAProject.objects.get(id=id))

    return projects(request)
 def perform_destroy(self, instance):
     delete_project(instance)