Exemplo n.º 1
0
    def test_show_no_integration(self):
        idProject = Project.objects.all()[0].id
        request = self.factory.get('/api_getWorkItems/', {'id_project': idProject})

        request.user = self.user

        response = views.api_getWorkItems(request)
        self.assertEqual(response.status_code, 200)
        self.assertContains(response, _('No Integration found'))
Exemplo n.º 2
0
    def test_show_no_integration(self):
        idProject = Project.objects.all()[0].id
        request = self.factory.get('/api_getWorkItems/',
                                   {'id_project': idProject})

        request.user = self.user

        response = views.api_getWorkItems(request)
        self.assertEqual(response.status_code, 200)
        self.assertContains(response, _('No Integration found'))
Exemplo n.º 3
0
    def test_show_issues(self):
        self.integration = Integration(user = self.user, tool = 1, project = self.project, url = 'http://10.0.0.1/polarion', username = '******', password = crypto.encrypt('admin'), query = 'project.id:ProjectPeriod AND type:defect')
        self.integration.save()

        idProject = Project.objects.all()[0].id
        request = self.factory.get('/api_getWorkItems/', {'id_project': idProject})

        request.user = self.user

        response = views.api_getWorkItems(request)
        self.assertEqual(response.status_code, 200)
Exemplo n.º 4
0
    def test_show_issues(self):
        self.integration = Integration(user = self.user, tool = 0, project = self.project, url = 'http://10.0.0.1/thebuggenie/thebuggenie/projectperiod', username = '******', password = '******')
        self.integration.save()

        idProject = Project.objects.all()[0].id
        request = self.factory.get('/api_getWorkItems/', {'id_project': idProject})

        request.user = self.user

        response = views.api_getWorkItems(request)
        self.assertEqual(response.status_code, 200)
Exemplo n.º 5
0
    def test_show_issues_denied(self):
        self.integrationDeny = Integration(user = self.user, tool = 1, project = self.project, url = 'http://10.0.0.1/polarion', username = '******', password = crypto.encrypt('wrong'))
        self.integrationDeny.save()

        idProject = Project.objects.all()[0].id
        request = self.factory.get('/api_getWorkItems/', {'id_project': idProject})

        request.user = self.user

        response = views.api_getWorkItems(request)
        self.assertEqual(response.status_code, 200)
        self.assertContains(response, _('WorkItems could not be read'))
Exemplo n.º 6
0
    def test_show_issues_denied(self):
        self.integrationDeny = Integration(user=self.user,
                                           tool=1,
                                           project=self.project,
                                           url='http://10.0.0.1/polarion',
                                           username='******',
                                           password=crypto.encrypt('wrong'))
        self.integrationDeny.save()

        idProject = Project.objects.all()[0].id
        request = self.factory.get('/api_getWorkItems/',
                                   {'id_project': idProject})

        request.user = self.user

        response = views.api_getWorkItems(request)
        self.assertEqual(response.status_code, 200)
        self.assertContains(response, _('WorkItems could not be read'))
Exemplo n.º 7
0
    def test_show_issues(self):
        self.integration = Integration(
            user=self.user,
            tool=0,
            project=self.project,
            url='http://10.0.0.1/thebuggenie/thebuggenie/projectperiod',
            username='******',
            password='******')
        self.integration.save()

        idProject = Project.objects.all()[0].id
        request = self.factory.get('/api_getWorkItems/',
                                   {'id_project': idProject})

        request.user = self.user

        response = views.api_getWorkItems(request)
        self.assertEqual(response.status_code, 200)
Exemplo n.º 8
0
    def test_show_issues(self):
        self.integration = Integration(
            user=self.user,
            tool=1,
            project=self.project,
            url='http://10.0.0.1/polarion',
            username='******',
            password=crypto.encrypt('admin'),
            query='project.id:ProjectPeriod AND type:defect')
        self.integration.save()

        idProject = Project.objects.all()[0].id
        request = self.factory.get('/api_getWorkItems/',
                                   {'id_project': idProject})

        request.user = self.user

        response = views.api_getWorkItems(request)
        self.assertEqual(response.status_code, 200)