test(postgres): fix test_build_match_conditions for Postgres

This commit is contained in:
AarDG10 2025-11-04 12:55:08 +05:30
parent 5ec2d132c5
commit b955cdc4c0

View file

@ -221,8 +221,8 @@ class TestDBQuery(IntegrationTestCase):
# get as conditions
if frappe.db.db_type == "mariadb":
assertion_string = """(((ifnull(`tabTest Blog Post`.`name`, '')='' or `tabTest Blog Post`.`name` in ('_Test Blog Post 1', '_Test Blog Post'))))"""
else:
assertion_string = """(((ifnull(cast(`tabBlog Post`.`name` as varchar), '')='' or cast(`tabBlog Post`.`name` as varchar) in ('_Test Blog Post 1', '_Test Blog Post'))))"""
elif frappe.db.db_type == "postgres":
assertion_string = """(((ifnull(cast(`tabTest Blog Post`.`name` as varchar), '')='' or cast(`tabTest Blog Post`.`name` as varchar) in ('_Test Blog Post 1', '_Test Blog Post'))))"""
self.assertEqual(build_match_conditions(as_condition=True), assertion_string)