<commit_before># Copyright 2021 Binovo IT Human Project SL
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
from odoo.tests import common

from .common import TestL10nEsTicketBAIAPI


@common.at_install(False)
@common.post_install(True)
class TestL10nEsTicketBAITaxAgency(TestL10nEsTicketBAIAPI):
    def test_tbai_tax_agency_change(self):
        self.main_company.tbai_tax_agency_id = self.env.ref(
            "l10n_es_ticketbai_api.tbai_tax_agency_gipuzkoa"
        )
        self.main_company.onchange_tbai_tax_agency()
        self.assertTrue(self.main_company.tbai_test_available)
        self.assertTrue(self.main_company.tbai_pro_available)
        self.main_company.tbai_tax_agency_id.test_qr_base_url = False
        self.main_company.onchange_tbai_tax_agency()
        self.assertFalse(self.main_company.tbai_test_available)
        self.main_company.tbai_tax_agency_id = self.env.ref(
            "l10n_es_ticketbai_api.tbai_tax_agency_araba"
        )
        self.main_company.onchange_tbai_tax_agency()
        self.assertTrue(self.main_company.tbai_test_available)
        self.assertTrue(self.main_company.tbai_pro_available)
        self.main_company.tbai_tax_agency_id.test_qr_base_url = False
        self.main_company.tbai_tax_agency_id.qr_base_url = ""
        self.main_company.tbai_tax_agency_id.tbai_pro_available = False
        self.main_company.onchange_tbai_tax_agency()<commit_msg>[FIX] l10n_es_ticketbai_api: Fix tests<commit_after># Copyright 2021 Binovo IT Human Project SL
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).

from .common import TestL10nEsTicketBAIAPI


class TestL10nEsTicketBAITaxAgency(TestL10nEsTicketBAIAPI):
    def test_tbai_tax_agency_change(self):
        self.main_company.tbai_tax_agency_id = self.env.ref(
            "l10n_es_ticketbai_api.tbai_tax_agency_gipuzkoa"
        )
        self.main_company.onchange_tbai_tax_agency()
        self.assertTrue(self.main_company.tbai_test_available)
        self.assertTrue(self.main_company.tbai_pro_available)
        self.main_company.tbai_tax_agency_id.test_qr_base_url = False
        self.main_company.onchange_tbai_tax_agency()
        self.assertFalse(self.main_company.tbai_test_available)
        self.main_company.tbai_tax_agency_id = self.env.ref(
            "l10n_es_ticketbai_api.tbai_tax_agency_araba"
        )
        self.main_company.onchange_tbai_tax_agency()
        self.assertTrue(self.main_company.tbai_test_available)
        self.assertTrue(self.main_company.tbai_pro_available)
        self.main_company.tbai_tax_agency_id.test_qr_base_url = False
        self.main_company.tbai_tax_agency_id.qr_base_url = ""
        self.main_company.onchange_tbai_tax_agency()
{'fraction_non_alphanumeric': 0.07850330154071901, 'fraction_numerical': 0.012472487160674981, 'mean_word_length': 3.9853747714808043, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 2, 'lorem ipsum': 0, 'www.': 2, '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': '5628376', 'n_tokens_mistral': 1028, 'n_tokens_neox': 977, 'n_words': 92}