Skip to content

Commit ad274ad

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 b333083 commit ad274ad

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
@@ -1228,7 +1228,10 @@ def test_invalid(self):
12281228
Country.search([('create_date', '>>', 'foo')])
12291229

12301230
# TODO make it "Invalid operator"" for consistency
1231-
with self.assertRaisesRegex(ValueError, r"^stray % in format '%'$"):
1231+
with self.assertRaisesRegex(
1232+
ValueError,
1233+
r"^(time data 'foo' does not match|stray % in) format '%'$",
1234+
):
12321235
Country.search([]).filtered_domain([('create_date', '>>', 'foo')])
12331236

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

0 commit comments

Comments
 (0)