]> asedeno.scripts.mit.edu Git - bluechips.git/blobdiff - bluechips/tests/__init__.py
Make the built-in tests actually pass
[bluechips.git] / bluechips / tests / __init__.py
index 363fa4ab4c3cf6c84d03ee9fcc7e33e96e421fa9..115391c09168f931daa4a265664e596597683a28 100644 (file)
@@ -15,10 +15,24 @@ from paste.script.appinstall import SetupCommand
 from pylons import config
 from routes import url_for
 
+from bluechips import model
+from bluechips.model import meta
+
 __all__ = ['url_for', 'TestController']
 
-# Invoke websetup with the current config file
-SetupCommand('setup-app').run([config['__file__']])
+def setup():
+    # Invoke websetup with the current config file
+    SetupCommand('setup-app').run([config['__file__']])
+    
+    test_user = model.User()
+    test_user.username = u'root'
+    test_user.name = u'Charlie Root'
+    test_user.resident = True
+    meta.Session.save(test_user)
+    meta.Session.commit()
+
+def teardown():
+    meta.metadata.drop_all()
 
 class TestController(TestCase):