<commit_before># -*- coding: utf-8 -*-
from __future__ import unicode_literals

from django.urls import reverse

from InvenTree.api_tester import InvenTreeAPITestCase

import report.models as report_models


class ReportTest(InvenTreeAPITestCase):

    fixtures = [
        'category',
        'part',
        'company',
        'location',
        'supplier_part',
        'stock',
        'stock_tests',
    ]

    model = None
    list_url = None
    detail_url = None
    print_url = None

    def setUp(self):
        super().setUp()

    def test_list_endpoint(self):
        """
        Test that the LIST endpoint works for each report
        """

        if self.list_url:
            url = reverse(self.list_url)

            print("URL:", url)
            response = self.get(url)
            self.assertEqual(response.status_code, 200)
            print("Response:")
            print(response)
            print(response.data)


class TestReportTest(ReportTest):

    model = report_models.TestReport

    list_url = 'api-stockitem-testreport-list'
    detail_url = 'api-stockitem-testreport-detail'
    print_url = 'api-stockitem-testreport-print'


class BuildReportTest(ReportTest):

    model = report_models.BuildReport

    list_url = 'api-build-report-list'
    detail_url = 'api-build-report-detail'
    print_url = 'api-build-report-print'


class BOMReportTest(ReportTest):

    model = report_models.BillOfMaterialsReport

    list_url = 'api-bom-report-list'
    detail_url = 'api-bom-report-detail'
    print_url = 'api-bom-report-print'


class POReportTest(ReportTest):

    model = report_models.PurchaseOrderReport

    list_url = 'api-po-report-list'
    detail_url = 'api-po-report-detail'
    print_url = 'api-po-report-print'

class SOReportTest(ReportTest):

    model = report_models.SalesOrderReport

    list_url = 'api-so-report-list'
    detail_url = 'api-so-report-detail'<commit_msg>PEP fixes<commit_after># -*- coding: utf-8 -*-
from __future__ import unicode_literals

from django.urls import reverse

from InvenTree.api_tester import InvenTreeAPITestCase

import report.models as report_models


class ReportTest(InvenTreeAPITestCase):

    fixtures = [
        'category',
        'part',
        'company',
        'location',
        'supplier_part',
        'stock',
        'stock_tests',
    ]

    model = None
    list_url = None
    detail_url = None
    print_url = None

    def setUp(self):
        super().setUp()

    def test_list_endpoint(self):
        """
        Test that the LIST endpoint works for each report
        """

        if self.list_url:
            url = reverse(self.list_url)

            print("URL:", url)
            response = self.get(url)
            self.assertEqual(response.status_code, 200)
            print("Response:")
            print(response)
            print(response.data)


class TestReportTest(ReportTest):

    model = report_models.TestReport

    list_url = 'api-stockitem-testreport-list'
    detail_url = 'api-stockitem-testreport-detail'
    print_url = 'api-stockitem-testreport-print'


class BuildReportTest(ReportTest):

    model = report_models.BuildReport

    list_url = 'api-build-report-list'
    detail_url = 'api-build-report-detail'
    print_url = 'api-build-report-print'


class BOMReportTest(ReportTest):

    model = report_models.BillOfMaterialsReport

    list_url = 'api-bom-report-list'
    detail_url = 'api-bom-report-detail'
    print_url = 'api-bom-report-print'


class POReportTest(ReportTest):

    model = report_models.PurchaseOrderReport

    list_url = 'api-po-report-list'
    detail_url = 'api-po-report-detail'
    print_url = 'api-po-report-print'


class SOReportTest(ReportTest):

    model = report_models.SalesOrderReport

    list_url = 'api-so-report-list'
    detail_url = 'api-so-report-detail'
{'fraction_non_alphanumeric': 0.10548194336191219, 'fraction_numerical': 0.0020784619381657575, 'mean_word_length': 2.6701620591039084, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4479045', 'n_tokens_mistral': 1257, 'n_tokens_neox': 1204, 'n_words': 224}