- def setup(self):
- with psycopg2.connect(database='postgres') as conn:
- conn.set_isolation_level(0)
- with conn.cursor() as cur:
- cur.execute('DROP DATABASE IF EXISTS {}'.format(self.name))
- cur.execute('CREATE DATABASE {}'.format(self.name))
- self.conn = psycopg2.connect(database=self.name)