This is unsafe.

example `"select 1 from pg_views where viewname = '{0}'".format('hel\'lo')` we should to do this properly.

OK this is a test but it is still bad practice to do it anywhere.  Fis it or add a comment saying how evil you are being as it is a test, and I'll accept things.