コード例 #1
0
    def get_context_data(self, **kwargs):
        data = super().get_context_data(**kwargs)

        case = TestCase.objects.get(pk=kwargs['case_id'])
        case_run = TestCaseRun.objects.get(pk=self.caserun_id)

        # Data of TestCase
        test_case_text = case.get_text_with_version(self.case_text_version)

        # Data of TestCaseRun
        caserun_comments = get_comments(case_run)

        caserun_status = TestCaseRunStatus.objects.values('pk', 'name')
        caserun_status = caserun_status.order_by('pk')
        bugs = group_case_bugs(case_run.case.get_bugs().order_by('bug_id'))

        data.update({
            'test_case': case,
            'test_case_text': test_case_text,
            'test_case_run': case_run,
            'comments_count': len(caserun_comments),
            'caserun_comments': caserun_comments,
            'caserun_logs': case_run.history.all(),
            'test_status': caserun_status,
            'grouped_case_bugs': bugs,
        })

        return data
コード例 #2
0
    def get_context_data(self, **kwargs):
        data = super().get_context_data(**kwargs)

        case = TestCase.objects.get(pk=kwargs['case_id'])
        execution = TestExecution.objects.get(pk=self.caserun_id)

        # Data of TestCase
        test_case_text = case.get_text_with_version(self.case_text_version)

        # Data of TestExecution
        execution_comments = get_comments(execution)

        execution_status = TestExecutionStatus.objects.values(
            'pk', 'name').order_by('pk')

        data.update({
            'test_case': case,
            'test_case_text': test_case_text,
            'execution': execution,
            'comments_count': len(execution_comments),
            'execution_comments': execution_comments,
            'execution_logs': execution.history.all(),
            'execution_status': execution_status,
        })

        return data
コード例 #3
0
ファイル: views.py プロジェクト: pasignature/Kiwi
    def get_context_data(self, **kwargs):
        data = super().get_context_data(**kwargs)

        caserun = TestCaseRun.objects.get(pk=self.caserun_id)
        comments = get_comments(caserun)

        data.update({
            'test_caserun': caserun,
            'comments': comments.iterator(),
        })
        return data