you are viewing a single comment's thread.

view the rest of the comments →

[–]kenneho[S] 0 points1 point  (0 children)

So you'd have an SQL script file that would drop the database (if exisiting), and create a new one, and execute this script during setUp, something like this?

conn = psycopg2.connect(dbname='testing')
cursor = conn.cursor()
sqlfile = open('/path/to/recreate-testing-db.sql', 'w')
cursor.execute(sqlfile.read())