summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris McDonough <chrism@agendaless.com>2009-05-11 03:48:42 +0000
committerChris McDonough <chrism@agendaless.com>2009-05-11 03:48:42 +0000
commitdcc9eb77b682917c535e8a40136aee59be7704ad (patch)
tree9e8d9deac0bb49f6ccbc79650bdf2cc91c03f72f
parent7a0439fe988499b58df7dfcd5dd9cce480b214b6 (diff)
downloadpyramid-dcc9eb77b682917c535e8a40136aee59be7704ad.tar.gz
pyramid-dcc9eb77b682917c535e8a40136aee59be7704ad.tar.bz2
pyramid-dcc9eb77b682917c535e8a40136aee59be7704ad.zip
Nobody knows how to test this yet.
-rw-r--r--repoze/bfg/paster_templates/routesalchemy/+package+/tests.py_tmpl73
-rw-r--r--repoze/bfg/paster_templates/routesalchemy/setup.py_tmpl1
2 files changed, 0 insertions, 74 deletions
diff --git a/repoze/bfg/paster_templates/routesalchemy/+package+/tests.py_tmpl b/repoze/bfg/paster_templates/routesalchemy/+package+/tests.py_tmpl
deleted file mode 100644
index c52ab2762..000000000
--- a/repoze/bfg/paster_templates/routesalchemy/+package+/tests.py_tmpl
+++ /dev/null
@@ -1,73 +0,0 @@
-import unittest
-
-from repoze.bfg import testing
-
-class ViewTests(unittest.TestCase):
-
- """ These tests are unit tests for the view. They test the
- functionality of *only* the view. They register and use dummy
- implementations of repoze.bfg functionality to allow you to avoid
- testing 'too much'"""
-
- def setUp(self):
- """ cleanUp() is required to clear out the application registry
- between tests (done in setUp for good measure too)
- """
- testing.cleanUp()
-
- def tearDown(self):
- """ cleanUp() is required to clear out the application registry
- between tests
- """
- testing.cleanUp()
-
- def test_my_view(self):
- from {{package}}.views import my_view
- context = testing.DummyModel()
- request = testing.DummyRequest()
- renderer = testing.registerDummyRenderer('templates/mytemplate.pt')
- response = my_view(context, request)
- renderer.assert_(project='{{project}}')
-
-class ViewIntegrationTests(unittest.TestCase):
- """ These tests are integration tests for the view. These test
- the functionality the view *and* its integration with the rest of
- the repoze.bfg framework. They cause the entire environment to be
- set up and torn down as if your application was running 'for
- real'. This is a heavy-hammer way of making sure that your tests
- have enough context to run properly, and it tests your view's
- integration with the rest of BFG. You should not use this style
- of test to perform 'true' unit testing as tests will run faster
- and will be easier to write if you use the testing facilities
- provided by bfg and only the registrations you need, as in the
- above ViewTests.
- """
- def setUp(self):
- """ This sets up the application registry with the
- registrations your application declares in its configure.zcml
- (including dependent registrations for repoze.bfg itself).
- """
- testing.cleanUp()
- import {{package}}
- import zope.configuration.xmlconfig
- zope.configuration.xmlconfig.file('configure.zcml',
- package={{package}})
-
- def tearDown(self):
- """ Clear out the application registry """
- testing.cleanUp()
-
- def test_my_view(self):
- from {{package}}.views import my_view
- context = testing.DummyModel()
- request = testing.DummyRequest()
- result = my_view(context, request)
- self.assertEqual(result.status, '200 OK')
- body = result.app_iter[0]
- self.failUnless('Welcome to' in body)
- self.assertEqual(len(result.headerlist), 2)
- self.assertEqual(result.headerlist[0],
- ('Content-Type', 'text/html; charset=UTF-8'))
- self.assertEqual(result.headerlist[1], ('Content-Length',
- str(len(body))))
-
diff --git a/repoze/bfg/paster_templates/routesalchemy/setup.py_tmpl b/repoze/bfg/paster_templates/routesalchemy/setup.py_tmpl
index 76f3ce639..55cf190a3 100644
--- a/repoze/bfg/paster_templates/routesalchemy/setup.py_tmpl
+++ b/repoze/bfg/paster_templates/routesalchemy/setup.py_tmpl
@@ -41,7 +41,6 @@ setup(name='{{project}}',
'transaction',
'zope.sqlalchemy',
],
- test_suite="{{package}}",
entry_points = """\
[paste.app_factory]
app = {{package}}.run:app