def compare_result_for_issue_type(self):
        filters = {
            'company': '_Test Company',
            'based_on': 'Issue Type',
            'from_date': add_months(getdate(), -1),
            'to_date': getdate(),
            'range': 'Monthly'
        }

        report = execute(filters)

        expected_data = [{
            'issue_type': 'Discomfort',
            self.last_month: 1.0,
            self.current_month: 0.0,
            'total': 1.0
        }, {
            'issue_type': 'Service Request',
            self.last_month: 0.0,
            self.current_month: 1.0,
            'total': 1.0
        }, {
            'issue_type': 'Bug',
            self.last_month: 1.0,
            self.current_month: 1.0,
            'total': 2.0
        }]

        self.assertEqual(expected_data, report[1])  # rows
        self.assertEqual(len(report[0]), 4)  # cols
    def compare_result_for_assignment(self):
        filters = {
            'company': '_Test Company',
            'based_on': 'Assigned To',
            'from_date': add_months(getdate(), -1),
            'to_date': getdate(),
            'range': 'Monthly'
        }

        report = execute(filters)

        expected_data = [{
            'user': '******',
            self.last_month: 1.0,
            self.current_month: 1.0,
            'total': 2.0
        }, {
            'user': '******',
            self.last_month: 2.0,
            self.current_month: 1.0,
            'total': 3.0
        }]

        self.assertEqual(expected_data, report[1])  # rows
        self.assertEqual(len(report[0]), 4)  # cols
    def compare_result_for_customer(self):
        filters = {
            'company': '_Test Company',
            'based_on': 'Customer',
            'from_date': add_months(getdate(), -1),
            'to_date': getdate(),
            'range': 'Monthly'
        }

        report = execute(filters)

        expected_data = [{
            'customer': '__Test Customer 2',
            self.last_month: 1.0,
            self.current_month: 0.0,
            'total': 1.0
        }, {
            'customer': '__Test Customer 1',
            self.last_month: 0.0,
            self.current_month: 1.0,
            'total': 1.0
        }, {
            'customer': '__Test Customer',
            self.last_month: 1.0,
            self.current_month: 1.0,
            'total': 2.0
        }]

        self.assertEqual(expected_data, report[1])  # rows
        self.assertEqual(len(report[0]), 4)  # cols
    def compare_result_for_issue_priority(self):
        filters = {
            'company': '_Test Company',
            'based_on': 'Issue Priority',
            'from_date': add_months(getdate(), -1),
            'to_date': getdate(),
            'range': 'Monthly'
        }

        report = execute(filters)

        expected_data = [{
            'priority': 'Medium',
            self.last_month: 1.0,
            self.current_month: 1.0,
            'total': 2.0
        }, {
            'priority': 'Low',
            self.last_month: 1.0,
            self.current_month: 0.0,
            'total': 1.0
        }, {
            'priority': 'High',
            self.last_month: 0.0,
            self.current_month: 1.0,
            'total': 1.0
        }]

        self.assertEqual(expected_data, report[1])  # rows
        self.assertEqual(len(report[0]), 4)  # cols
Beispiel #5
0
    def compare_result_for_issue_type(self):
        filters = {
            "company": "_Test Company",
            "based_on": "Issue Type",
            "from_date": add_months(getdate(), -1),
            "to_date": getdate(),
            "range": "Monthly",
        }

        report = execute(filters)

        expected_data = [
            {
                "issue_type": "Discomfort",
                self.last_month: 1.0,
                self.current_month: 0.0,
                "total": 1.0
            },
            {
                "issue_type": "Service Request",
                self.last_month: 0.0,
                self.current_month: 1.0,
                "total": 1.0
            },
            {
                "issue_type": "Bug",
                self.last_month: 1.0,
                self.current_month: 1.0,
                "total": 2.0
            },
        ]

        self.assertEqual(expected_data, report[1])  # rows
        self.assertEqual(len(report[0]), 4)  # cols
Beispiel #6
0
    def compare_result_for_customer(self):
        filters = {
            "company": "_Test Company",
            "based_on": "Customer",
            "from_date": add_months(getdate(), -1),
            "to_date": getdate(),
            "range": "Monthly",
        }

        report = execute(filters)

        expected_data = [
            {
                "customer": "__Test Customer 2",
                self.last_month: 1.0,
                self.current_month: 0.0,
                "total": 1.0
            },
            {
                "customer": "__Test Customer 1",
                self.last_month: 0.0,
                self.current_month: 1.0,
                "total": 1.0
            },
            {
                "customer": "__Test Customer",
                self.last_month: 1.0,
                self.current_month: 1.0,
                "total": 2.0
            },
        ]

        self.assertEqual(expected_data, report[1])  # rows
        self.assertEqual(len(report[0]), 4)  # cols
Beispiel #7
0
    def compare_result_for_assignment(self):
        filters = {
            "company": "_Test Company",
            "based_on": "Assigned To",
            "from_date": add_months(getdate(), -1),
            "to_date": getdate(),
            "range": "Monthly",
        }

        report = execute(filters)

        expected_data = [
            {
                "user": "******",
                self.last_month: 1.0,
                self.current_month: 1.0,
                "total": 2.0
            },
            {
                "user": "******",
                self.last_month: 2.0,
                self.current_month: 1.0,
                "total": 3.0
            },
        ]

        self.assertEqual(expected_data, report[1])  # rows
        self.assertEqual(len(report[0]), 4)  # cols
Beispiel #8
0
    def compare_result_for_issue_priority(self):
        filters = {
            "company": "_Test Company",
            "based_on": "Issue Priority",
            "from_date": add_months(getdate(), -1),
            "to_date": getdate(),
            "range": "Monthly",
        }

        report = execute(filters)

        expected_data = [
            {
                "priority": "Medium",
                self.last_month: 1.0,
                self.current_month: 1.0,
                "total": 2.0
            },
            {
                "priority": "Low",
                self.last_month: 1.0,
                self.current_month: 0.0,
                "total": 1.0
            },
            {
                "priority": "High",
                self.last_month: 0.0,
                self.current_month: 1.0,
                "total": 1.0
            },
        ]

        self.assertEqual(expected_data, report[1])  # rows
        self.assertEqual(len(report[0]), 4)  # cols