Skip to content

Commit 20e2810

Browse files
committed
[FIX] base: stdlib error message changed on test case
python/cpython#131568 Adapt the regex to handle both < 3.13 and >= 3.13 for this specific test case.
1 parent a1e3ad7 commit 20e2810

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

odoo/addons/base/tests/test_expression.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1219,7 +1219,10 @@ def test_invalid(self):
12191219
Country.search([('create_date', '>>', 'foo')])
12201220

12211221
# TODO make it "Invalid operator"" for consistency
1222-
with self.assertRaisesRegex(ValueError, r"^stray % in format '%'$"):
1222+
with self.assertRaisesRegex(
1223+
ValueError,
1224+
r"^(time data 'foo' does not match|stray % in) format '%'$",
1225+
):
12231226
Country.search([]).filtered_domain([('create_date', '>>', 'foo')])
12241227

12251228
with self.assertRaisesRegex(ValueError, r"Invalid isoformat string"):

0 commit comments

Comments
 (0)