Skip to content

Commit 8166baa

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 0e68aa3 commit 8166baa

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
@@ -1001,7 +1001,10 @@ def test_invalid(self):
10011001
with self.assertRaisesRegex(ValueError, r"^Invalid leaf \('create_date', '>>', 'foo'\)$"):
10021002
Country.search([('create_date', '>>', 'foo')])
10031003

1004-
with self.assertRaisesRegex(ValueError, r"^stray % in format '%'$"):
1004+
with self.assertRaisesRegex(
1005+
ValueError,
1006+
r"^(time data 'foo' does not match|stray % in) format '%'$",
1007+
):
10051008
Country.search([]).filtered_domain([('create_date', '>>', 'foo')])
10061009

10071010
with self.assertRaisesRegex(psycopg2.DataError, r"invalid input syntax"):

0 commit comments

Comments
 (0)