Actually it's a lot better of an idea to load the full application out
authorChristopher Allan Webber <cwebber@dustycloud.org>
Sun, 5 Jun 2011 15:33:59 +0000 (10:33 -0500)
committerChristopher Allan Webber <cwebber@dustycloud.org>
Sun, 5 Jun 2011 15:33:59 +0000 (10:33 -0500)
of the paste config file the way paste would than to load components
of it ourselves.

Aside from this being nicer, it's also necessary for the sake of
getting the middleware working nicely.  We could do it ourselves, but
why bother when paste can just do it for us?

mediagoblin/tests/tools.py

index 70b74b897684139a71b2eaeae844f77f94e4d1f4..a51402e9d90c7b12cf8d7252f5fadbaf9e355b96 100644 (file)
 import pkg_resources
 import os, shutil
 
-from paste.deploy import appconfig
+from paste.deploy import appconfig, loadapp
 from webtest import TestApp
 
-from mediagoblin import app
 from mediagoblin.db.open import setup_connection_and_db_from_config
 
 
@@ -88,7 +87,7 @@ def get_test_app(dump_old_app=True):
     # TODO: Drop and recreate indexes
 
     # setup app and return
-    test_app = app.paste_app_factory(
-        config.global_conf, **config.local_conf)
+    test_app = loadapp(
+        'config:' + TEST_APP_CONFIG)
 
     return TestApp(test_app)