From f3eb47d6f37ddd1eeddc9b275d06bddf8333a1d2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20P=C3=A9ters?= Date: Fri, 2 Apr 2021 10:56:17 +0200 Subject: [PATCH] tests: check against specific db name in test_delete_tenant_with_sql (#52649) --- tests/test_ctl.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/tests/test_ctl.py b/tests/test_ctl.py index 49bd9ebf4..f8fbe5a83 100644 --- a/tests/test_ctl.py +++ b/tests/test_ctl.py @@ -205,7 +205,7 @@ def test_trigger_jumps(pub): assert not f2.workflow_data -def test_delete_tenant_with_sql(): +def test_delete_tenant_with_sql(freezer): pub = create_temporary_pub(sql_mode=True) delete_cmd = CmdDeleteTenant() @@ -214,6 +214,7 @@ def test_delete_tenant_with_sql(): sub_options_class = collections.namedtuple('Options', ['force_drop']) sub_options = sub_options_class(False) + freezer.move_to('2018-12-01T00:00:00') delete_cmd.delete_tenant(pub, sub_options, []) assert not os.path.isdir(pub.app_dir) @@ -225,7 +226,8 @@ def test_delete_tenant_with_sql(): cur.execute( """SELECT schema_name FROM information_schema.schemata - WHERE schema_name like '%removed%'""" + WHERE schema_name like 'removed_20181201_%%%s'""" + % pub.cfg['postgresql']['database'] ) assert len(cur.fetchall()) == 1 @@ -299,7 +301,8 @@ def test_delete_tenant_with_sql(): cur.execute( """SELECT datname FROM pg_database - WHERE datname like '%removed%'""" + WHERE datname like 'removed_20181201_%%%s'""" + % pub.cfg['postgresql']['database'] ) result = cur.fetchall()