From 1eed8a7d75f9c0c949cddab166b77803b5ae4218 Mon Sep 17 00:00:00 2001 From: Iryna Vyshnevska Date: Thu, 18 Jul 2019 18:10:43 +0300 Subject: [PATCH] [MIG][12.0] adapt tests to v12 --- .../tests/test_reconciliation.py | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) diff --git a/account_reconcile_restrict_partner_mismatch/tests/test_reconciliation.py b/account_reconcile_restrict_partner_mismatch/tests/test_reconciliation.py index a21c6af9..13be4455 100644 --- a/account_reconcile_restrict_partner_mismatch/tests/test_reconciliation.py +++ b/account_reconcile_restrict_partner_mismatch/tests/test_reconciliation.py @@ -31,11 +31,6 @@ class TestReconciliation(AccountingTestCase): self.bank_journal = self.env['account.journal']. \ create({'name': 'Bank', 'type': 'bank', 'code': 'BNK67'}) self.aml = self.init_moves() - self.wizard = self.env['account.move.line.reconcile.writeoff']. \ - with_context(active_ids=[x.id for x in self.aml]).create({ - 'journal_id': self.bank_journal.id, - 'writeoff_acc_id': self.account_rsa.id - }) def create_move(self, name, amount): debit_line_vals = { @@ -73,22 +68,22 @@ class TestReconciliation(AccountingTestCase): return aml_recs def test_reconcile_no_partner(self): - self.wizard.trans_rec_reconcile() + self.aml.reconcile() self.assertTrue(all(self.aml.mapped('reconciled'))) def test_reconcile_partner_mismatch(self): self.aml[0].partner_id = self.partner.id with self.assertRaises(UserError): - self.wizard.trans_rec_reconcile() + self.aml.reconcile() # all lines with same partner allowed self.aml.write({'partner_id': self.partner.id}) - self.wizard.trans_rec_reconcile() + self.aml.reconcile() self.assertTrue(all(self.aml.mapped('reconciled'))) def test_reconcile_accounts_excluded(self): self.aml[0].partner_id = self.partner.id with self.assertRaises(UserError): - self.wizard.trans_rec_reconcile() + self.aml.reconcile() # reconciliation forbiden only for certain types of accounts account = self.env['account.account'].search([ ('user_type_id.type', '=', 'other') @@ -96,9 +91,9 @@ class TestReconciliation(AccountingTestCase): account.reconcile = True self.aml[0].account_id = account.id with self.assertRaises(UserError): - self.wizard.trans_rec_reconcile() + self.aml.reconcile() # reconciliation for different partners allowed # for not forbidden types self.aml.write({'account_id': account.id}) - self.wizard.trans_rec_reconcile() + self.aml.reconcile() self.assertTrue(all(self.aml.mapped('reconciled')))