Skip to content

Commit 137b50c

Browse files
committed
[IMP] tests: Fixed unit tests after res.bank removal
This commit fixes the upgrade-util tests that failed due to the removal of res.bank model. The model res.bank was replaced with res.partner. task-5145618
1 parent 9a1be7d commit 137b50c

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/base/tests/test_util.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -333,10 +333,10 @@ def test_any_operator(self):
333333
self.assertEqual(new_domain, expected)
334334

335335
# test it also works recursively
336-
domain = [("partner_id", "any", [("bank_ids", "not any", [("acc_number", "like", "S.A.")])])]
336+
domain = [("partner_id", "any", [("bank_ids", "not any", [("account_number", "like", "S.A.")])])]
337337
expected = [("partner_id", "any", [("bank_ids", "not any", [("acc_nbr", "like", "S.A.")])])]
338338

339-
new_domain = _adapt_one_domain(self.cr, "res.partner.bank", "acc_number", "acc_nbr", "res.company", domain)
339+
new_domain = _adapt_one_domain(self.cr, "res.partner.bank", "account_number", "acc_nbr", "res.company", domain)
340340
self.assertEqual(new_domain, expected)
341341

342342

@@ -2612,8 +2612,8 @@ def test_assert_updated(self):
26122612
with self.assertUpdated("res_partner", ids=[]):
26132613
p1.city = "Underground"
26142614
util.flush(p1)
2615-
with self.assertRaises(AssertionError), self.assertUpdated("res_bank", ids=[]):
2616-
self.env["res.bank"].create({"name": "Annie Leonhart"})
2615+
with self.assertRaises(AssertionError), self.assertUpdated("res_partner", ids=[]):
2616+
self.env["res.partner"].create({"name": "Annie Leonhart"})
26172617

26182618
# when ids has multiple records, all records should be updated
26192619
with self.assertUpdated("res_partner", ids=[p1.id, p2.id]):
@@ -2646,8 +2646,8 @@ def test_assert_not_updated(self):
26462646
self.env["res.partner"].create({"name": "Bertolt Hoover"})
26472647

26482648
# when ids is [], assert no record is updated
2649-
with self.assertNotUpdated("res_bank", ids=[]):
2650-
self.env["res.bank"].create({"name": "Marco Bodt"})
2649+
with self.assertNotUpdated("res_partner", ids=[]):
2650+
self.env["res.partner"].create({"name": "Marco Bodt"})
26512651
with self.assertRaises(AssertionError), self.assertNotUpdated("res_partner", ids=[]):
26522652
p2.city = "Shiganshina"
26532653
util.flush(p2)

0 commit comments

Comments
 (0)