[Zope3-checkins] SVN: Zope3/branches/ajung-target-requestpublication-next-try-branch/src/zope/app/publication/tests/test_browserpublication.py added test fixture to provide registered publication factories

Tarek Ziadé tziade at nuxeo.com
Sat Oct 8 05:15:38 EDT 2005


Log message for revision 38922:
  added test fixture to provide registered publication factories

Changed:
  U   Zope3/branches/ajung-target-requestpublication-next-try-branch/src/zope/app/publication/tests/test_browserpublication.py

-=-
Modified: Zope3/branches/ajung-target-requestpublication-next-try-branch/src/zope/app/publication/tests/test_browserpublication.py
===================================================================
--- Zope3/branches/ajung-target-requestpublication-next-try-branch/src/zope/app/publication/tests/test_browserpublication.py	2005-10-08 09:10:38 UTC (rev 38921)
+++ Zope3/branches/ajung-target-requestpublication-next-try-branch/src/zope/app/publication/tests/test_browserpublication.py	2005-10-08 09:15:38 UTC (rev 38922)
@@ -13,7 +13,7 @@
 ##############################################################################
 """Browser Publication Tests
 
-$Id$
+$Id: test_browserpublication.py 38357 2005-09-07 20:14:34Z srichter $
 """
 import unittest
 from zope.testing import doctest
@@ -289,6 +289,20 @@
 
 class HTTPPublicationRequestFactoryTests(BasePublicationTests):
 
+    def setUp(self):
+        super(BasePublicationTests, self).setUp()
+        from zope.app.publication.metaconfigure import getFactoryRegistry
+        from zope.app.publication.requestpublicationfactories \
+            import SOAPFactory, XMLRPCFactory, HTTPFactory, BrowserFactory
+        registerer = getFactoryRegistry()
+
+        registerer.register('*', '*', 'HTTP', 0, HTTPFactory())
+        registerer.register('POST', 'text/xml', 'SOAP', 20, SOAPFactory())
+        registerer.register('POST', 'text/xml', 'XMLRPC', 10, XMLRPCFactory())
+        registerer.register('GET', '*', 'BROWSER', 10, BrowserFactory())
+        registerer.register('POST', '*', 'BROWSER', 10, BrowserFactory())
+        registerer.register('HEAD', '*', 'BROWSER', 10, BrowserFactory())
+
     def testGetBackSamePublication(self):
         factory = HTTPPublicationRequestFactory(db=None)
         args = (None, {})



More information about the Zope3-Checkins mailing list