Skip to content

Commit c47b71c

Browse files
committed
[FIX] adapt test to sale_subscription module
The upgrade of the `sale_subscription` module remove the model `sale.subscription` but keep the table. As this table as a FK on `res.country`, the `test_replace_record_references_batch__uniqueness` test needs to be adapted to ignore this table. This avoid a `matt` error when upgrading the `sale_subscription` module in version 16.0: https://upgradeci.odoo.com/upgradeci/run/125497 closes #60 Signed-off-by: Christophe Simonis (chs) <[email protected]>
1 parent 06085f5 commit c47b71c

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/base/tests/test_util.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -967,7 +967,11 @@ def test_replace_record_references_batch__uniqueness(self):
967967
{"name": "TEST2", "code": "T2", "state_ids": [(0, 0, {"name": "STATE2", "code": "STATE"})]}
968968
)
969969

970-
util.replace_record_references_batch(self.env.cr, {c2.id: c1.id}, "res.country")
970+
# `sale_subscription` as foreign key on `res_country`
971+
# ignore it to avoid the logging of an error in `model_of_table` when upgrading to v16 where the model
972+
# `sale.subscription` as been removed but the table kept.
973+
ignores = ["sale_subscription"]
974+
util.replace_record_references_batch(self.env.cr, {c2.id: c1.id}, "res.country", ignores=ignores)
971975
self.env.cr.execute("SELECT count(1) FROM res_country_state WHERE country_id=%s", [c1.id])
972976
[count] = self.env.cr.fetchone()
973977
self.assertEqual(count, 1)

0 commit comments

Comments
 (0)