コード例 #1
0
    def _report_data_context(self):
        data = {}
        form = self._get_search_form()

        if form.is_valid():
            summary_header_data = super(CustomDetailReport,
                                        self)._report_data_context()
            data.update(summary_header_data)

            build_ids = [build['build'] for build in data['builds']]

            status_matrix = self.walk_matrix_row_by_row(
                self._data.generate_status_matrix(build_ids)
            )

            status_ids = (TestCaseRunStatus.id_failed(),)
            failed_case_runs = self.read_case_runs(build_ids, status_ids)

            status_ids = (TestCaseRunStatus.id_blocked(),)
            blocked_case_runs = self.read_case_runs(build_ids, status_ids)

            data.update({
                'status_matrix': status_matrix,
                'failed_case_runs': failed_case_runs,
                'blocked_case_runs': blocked_case_runs,
            })
        else:
            data['report_errors'] = form.errors

        data['form'] = form
        return data
コード例 #2
0
ファイル: views.py プロジェクト: zumbi/Nitrate
    def _report_data_context(self):
        data = {}
        form = self._get_search_form()

        if form.is_valid():
            summary_header_data = super(CustomDetailReport,
                                        self)._report_data_context()
            data.update(summary_header_data)

            build_ids = [build.pk for build in data['builds']]
            # TODO: remove this after upgrading MySQL-python to 1.2.5
            build_ids = workaround_single_value_for_in_clause(build_ids)

            status_matrix = self.walk_matrix_row_by_row(
                self._data.generate_status_matrix(build_ids))

            # TODO: remove this after upgrading MySQL-python to 1.2.5
            status_ids = workaround_single_value_for_in_clause(
                (TestCaseRunStatus.id_failed(), ))
            failed_case_runs = self.read_case_runs(build_ids, status_ids)
            # TODO: remove this after upgrading MySQL-python to 1.2.5
            status_ids = workaround_single_value_for_in_clause(
                (TestCaseRunStatus.id_blocked(), ))
            blocked_case_runs = self.read_case_runs(build_ids, status_ids)

            data.update({
                'status_matrix': status_matrix,
                'failed_case_runs': failed_case_runs,
                'blocked_case_runs': blocked_case_runs,
            })
        else:
            data['report_errors'] = form.errors

        data['form'] = form
        return data
コード例 #3
0
    def _report_data_context(self):
        data = {}
        form = self._get_search_form()

        if form.is_valid():
            summary_header_data = super(CustomDetailReport,
                                        self)._report_data_context()
            data.update(summary_header_data)

            build_ids = [build.pk for build in data['builds']]
            # TODO: remove this after upgrading MySQL-python to 1.2.5
            build_ids = workaround_single_value_for_in_clause(build_ids)

            status_matrix = self.walk_matrix_row_by_row(
                self._data.generate_status_matrix(build_ids))

            # TODO: remove this after upgrading MySQL-python to 1.2.5
            status_ids = workaround_single_value_for_in_clause(
                (TestCaseRunStatus.id_failed(),))
            failed_case_runs = self.read_case_runs(build_ids, status_ids)
            # TODO: remove this after upgrading MySQL-python to 1.2.5
            status_ids = workaround_single_value_for_in_clause(
                (TestCaseRunStatus.id_blocked(),))
            blocked_case_runs = self.read_case_runs(build_ids, status_ids)

            data.update({
                'status_matrix': status_matrix,
                'failed_case_runs': failed_case_runs,
                'blocked_case_runs': blocked_case_runs,
            })
        else:
            data['report_errors'] = form.errors

        data['form'] = form
        return data
コード例 #4
0
ファイル: views.py プロジェクト: MrSenko/Nitrate
    def _report_data_context(self):
        data = {}
        form = self._get_search_form()

        if form.is_valid():
            summary_header_data = super(CustomDetailReport,
                                        self)._report_data_context()
            data.update(summary_header_data)

            build_ids = [build['build'] for build in data['builds']]

            status_matrix = self.walk_matrix_row_by_row(
                self._data.generate_status_matrix(build_ids)
            )

            status_ids = (TestCaseRunStatus.id_failed(),)
            failed_case_runs = self.read_case_runs(build_ids, status_ids)

            status_ids = (TestCaseRunStatus.id_blocked(),)
            blocked_case_runs = self.read_case_runs(build_ids, status_ids)

            data.update({
                'status_matrix': status_matrix,
                'failed_case_runs': failed_case_runs,
                'blocked_case_runs': blocked_case_runs,
            })
        else:
            data['report_errors'] = form.errors

        data['form'] = form
        return data