From 9806df55bbe71cfe8f1e3a5c62c51f23ae686563 Mon Sep 17 00:00:00 2001 From: Iryna Vyshnevska Date: Wed, 17 Feb 2021 16:05:48 +0200 Subject: [PATCH] [FIX] lint --- l10n_ch_base_bank/models/partner_bank.py | 2 +- l10n_ch_base_bank/tests/test_bank.py | 40 +++++++++++++++++------- 2 files changed, 29 insertions(+), 13 deletions(-) diff --git a/l10n_ch_base_bank/models/partner_bank.py b/l10n_ch_base_bank/models/partner_bank.py index db8f9f65c..80fd3e0e9 100644 --- a/l10n_ch_base_bank/models/partner_bank.py +++ b/l10n_ch_base_bank/models/partner_bank.py @@ -54,7 +54,7 @@ def _get_ch_bank_from_iban(self): @api.onchange("acc_number", "acc_type") def _onchange_acc_number_set_swiss_bank(self): - """ Deduce information from IBAN + """Deduce information from IBAN Bank is defined as: - Found bank by clearing when using iban diff --git a/l10n_ch_base_bank/tests/test_bank.py b/l10n_ch_base_bank/tests/test_bank.py index 0ef0cf38b..c68950400 100644 --- a/l10n_ch_base_bank/tests/test_bank.py +++ b/l10n_ch_base_bank/tests/test_bank.py @@ -35,13 +35,19 @@ def setUpClass(cls): ) def new_form(self): - form = Form(self.env["res.partner.bank"], view="l10n_ch.isr_partner_bank_form",) + form = Form( + self.env["res.partner.bank"], + view="l10n_ch.isr_partner_bank_form", + ) form.partner_id = self.partner return form def new_empty_form(self): # in some cases we need form without partner - form = Form(self.env["res.partner.bank"], view="l10n_ch.isr_partner_bank_form",) + form = Form( + self.env["res.partner.bank"], + view="l10n_ch.isr_partner_bank_form", + ) return form def test_bank_iban(self): @@ -93,7 +99,8 @@ def test_bank_postal(self): self.assertEqual(account.bank_id, self.bank) self.assertEqual( - account.acc_number, "ISR {} Azure Interior".format(CH_SUBSCRIPTION), + account.acc_number, + "ISR {} Azure Interior".format(CH_SUBSCRIPTION), ) self.assertEqual(account.l10n_ch_postal, CH_SUBSCRIPTION) self.assertEqual(account.acc_type, "bank") @@ -106,7 +113,8 @@ def test_postal_set_bank_post(self): self.assertFalse(account.bank_id) # if acc_number given by user don't update it self.assertEqual( - account.acc_number, CH_POSTAL, + account.acc_number, + CH_POSTAL, ) self.assertEqual(account.l10n_ch_postal, CH_POSTAL) self.assertEqual(account.acc_type, "postal") @@ -248,7 +256,8 @@ def test_create_bank_default_acc_number(self): # account number set based on ccp self.assertEqual( - account.acc_number, "ISR {} Azure Interior".format(CH_SUBSCRIPTION), + account.acc_number, + "ISR {} Azure Interior".format(CH_SUBSCRIPTION), ) self.assertEqual(account.l10n_ch_postal, CH_SUBSCRIPTION) @@ -265,14 +274,16 @@ def test_onchange_post_bank_acc_number(self): # if it's ISR subscription, copy ISR + value in acc_number bank_acc.l10n_ch_postal = CH_SUBSCRIPTION self.assertEqual( - bank_acc.acc_number, "ISR {}".format(CH_SUBSCRIPTION), + bank_acc.acc_number, + "ISR {}".format(CH_SUBSCRIPTION), ) # if it's ISR subscription, copy ISR + value in acc_number # In this case we have the partner set bank_acc.partner_id = self.partner self.assertEqual( - bank_acc.acc_number, "ISR {} Azure Interior".format(CH_SUBSCRIPTION), + bank_acc.acc_number, + "ISR {} Azure Interior".format(CH_SUBSCRIPTION), ) self.assertEqual(bank_acc.l10n_ch_postal, CH_SUBSCRIPTION) @@ -289,7 +300,8 @@ def test_onchange_post_bank_isr_in_acc_number(self): self.assertEqual(bank_acc.l10n_ch_postal, CH_SUBSCRIPTION) self.assertEqual( - bank_acc.acc_number, "ISR {} Azure Interior".format(CH_SUBSCRIPTION), + bank_acc.acc_number, + "ISR {} Azure Interior".format(CH_SUBSCRIPTION), ) def test_name_search(self): @@ -316,7 +328,8 @@ def test_multiple_postal_number_for_same_partner(self): self.assertFalse(account2.bank_id) self.assertEqual( - account2.acc_number, "ISR {} Azure Interior #1".format(CH_SUBSCRIPTION), + account2.acc_number, + "ISR {} Azure Interior #1".format(CH_SUBSCRIPTION), ) self.assertEqual(account2.acc_type, "bank") @@ -327,7 +340,8 @@ def test_multiple_postal_number_for_same_partner(self): # no bank matches self.assertFalse(account3.bank_id) self.assertEqual( - account3.acc_number, "ISR {} Azure Interior #2".format(CH_SUBSCRIPTION), + account3.acc_number, + "ISR {} Azure Interior #2".format(CH_SUBSCRIPTION), ) self.assertEqual(account3.acc_type, "bank") account3.unlink() @@ -339,7 +353,8 @@ def test_multiple_postal_number_for_same_partner(self): account4 = bank_acc_4.save() self.assertEqual( - account4.acc_number, "ISR {} Azure Interior #2".format(CH_SUBSCRIPTION), + account4.acc_number, + "ISR {} Azure Interior #2".format(CH_SUBSCRIPTION), ) def test_acc_name_generation(self): @@ -365,7 +380,8 @@ def test_acc_name_generation(self): account.l10n_ch_postal = CH_SUBSCRIPTION account._update_acc_number() self.assertEqual( - account.acc_number, "ISR {} Azure Interior".format(CH_SUBSCRIPTION), + account.acc_number, + "ISR {} Azure Interior".format(CH_SUBSCRIPTION), ) # remove partner name account.partner_id = ""