summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris McDonough <chrism@agendaless.com>2009-08-20 23:32:44 +0000
committerChris McDonough <chrism@agendaless.com>2009-08-20 23:32:44 +0000
commit45b545c377945812a83d926d11f1635d279069a6 (patch)
tree7930cfb33c17ccbcbd4f139b16555164f8a90014
parenta9454c13d890c5775d58735199f57caaf75aed33 (diff)
downloadpyramid-45b545c377945812a83d926d11f1635d279069a6.tar.gz
pyramid-45b545c377945812a83d926d11f1635d279069a6.tar.bz2
pyramid-45b545c377945812a83d926d11f1635d279069a6.zip
- "tests" module removed from the bfg_alchemy paster template; these
tests didn't work.
-rw-r--r--CHANGES.txt3
-rw-r--r--repoze/bfg/paster_templates/alchemy/+package+/tests.py_tmpl73
2 files changed, 3 insertions, 73 deletions
diff --git a/CHANGES.txt b/CHANGES.txt
index b022bf8c7..fca8c5f0d 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -1,6 +1,9 @@
Next release
============
+- "tests" module removed from the bfg_alchemy paster template; these
+ tests didn't work.
+
- Move (non-API) default_view, default_forbidden_view, and
default_notfound_view functions into the ``repoze.bfg.view`` module
(moved from ``repoze.bfg.router``).
diff --git a/repoze/bfg/paster_templates/alchemy/+package+/tests.py_tmpl b/repoze/bfg/paster_templates/alchemy/+package+/tests.py_tmpl
deleted file mode 100644
index c52ab2762..000000000
--- a/repoze/bfg/paster_templates/alchemy/+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))))
-