summaryrefslogtreecommitdiff
path: root/repoze/bfg/paster_templates/routesalchemy
diff options
context:
space:
mode:
Diffstat (limited to 'repoze/bfg/paster_templates/routesalchemy')
-rw-r--r--repoze/bfg/paster_templates/routesalchemy/+package+/run.py_tmpl4
-rw-r--r--repoze/bfg/paster_templates/routesalchemy/+package+/tests.py_tmpl6
2 files changed, 7 insertions, 3 deletions
diff --git a/repoze/bfg/paster_templates/routesalchemy/+package+/run.py_tmpl b/repoze/bfg/paster_templates/routesalchemy/+package+/run.py_tmpl
index 3b392debd..066dbecc0 100644
--- a/repoze/bfg/paster_templates/routesalchemy/+package+/run.py_tmpl
+++ b/repoze/bfg/paster_templates/routesalchemy/+package+/run.py_tmpl
@@ -18,12 +18,14 @@ def app(global_config, **settings):
It is usually called by the PasteDeploy framework during ``paster serve``.
"""
+ zcml_file = settings.get('configure_zcml', 'configure.zcml')
db_string = settings.get('db_string')
if db_string is None:
raise ValueError("No 'db_string' value in application configuration.")
initialize_sql(db_string)
config = Configurator(settings=settings)
- zcml_file = settings.get('configure_zcml', 'configure.zcml')
+ config.begin()
config.load_zcml(zcml_file)
+ config.end()
return config.make_wsgi_app()
diff --git a/repoze/bfg/paster_templates/routesalchemy/+package+/tests.py_tmpl b/repoze/bfg/paster_templates/routesalchemy/+package+/tests.py_tmpl
index 5c1477189..ed7f1280b 100644
--- a/repoze/bfg/paster_templates/routesalchemy/+package+/tests.py_tmpl
+++ b/repoze/bfg/paster_templates/routesalchemy/+package+/tests.py_tmpl
@@ -1,4 +1,5 @@
import unittest
+from repoze.bfg.configuration import Configurator
from repoze.bfg import testing
def _initTestingDB():
@@ -8,11 +9,12 @@ def _initTestingDB():
class TestMyView(unittest.TestCase):
def setUp(self):
- testing.setUp()
+ self.config = Configurator()
+ self.config.begin()
_initTestingDB()
def tearDown(self):
- testing.tearDown()
+ self.config.end()
def test_it(self):
from {{package}}.views import my_view