Commit c05f996e authored by Marc Duez's avatar Marc Duez
Browse files

test server : make sure a database already exist before test ( need to copy...

test server : make sure a database already exist before test ( need to copy it's shape for the test db)
parent 750d8e98
......@@ -47,19 +47,22 @@ import traceback
import shutil
from copy import copy
execfile("applications/vidjil/controllers/default.py", globals())
# create a test database by copying the original db
test_db = DAL('sqlite://testing1234.sqlite')
# build default database if doesn't exist
init_db()
test_db = DAL('sqlite://testing124.sqlite')
for tablename in db.tables: # Copy tables!
table_copy = [copy(f) for f in db[tablename]]
test_db.define_table(tablename, *table_copy)
db = test_db
execfile("applications/vidjil/controllers/default.py", globals())
init_db(True)
# use a fake user
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment