[Zope3-checkins] CVS: Zope3/src/zope/app/browser/services/translation/tests - test_translate.py:1.5

Stephan Richter srichter@cosmos.phy.tufts.edu
Sun, 20 Jul 2003 08:17:22 -0400


Update of /cvs-repository/Zope3/src/zope/app/browser/services/translation/tests
In directory cvs.zope.org:/tmp/cvs-serv2938/src/zope/app/browser/services/translation/tests

Modified Files:
	test_translate.py 
Log Message:
Fixed tests. Sorry to everyone about that. The reason it broke was that 
usually the ZCML makes a class a view (by adding the appropriate __init__
method, but when testing a view this does not exist, so you have to add
it yourself.

The reason the tests were failing was that I must have simply forgotten to
run them. Sorry again. Fixed now.


=== Zope3/src/zope/app/browser/services/translation/tests/test_translate.py 1.4 => 1.5 ===
--- Zope3/src/zope/app/browser/services/translation/tests/test_translate.py:1.4	Thu Mar 13 13:49:04 2003
+++ Zope3/src/zope/app/browser/services/translation/tests/test_translate.py	Sun Jul 20 08:17:16 2003
@@ -23,7 +23,7 @@
 from zope.component.factory import provideFactory
 
 from zope.app.browser.services.translation.translate \
-     import Translate
+     import Translate as Translate
 from zope.app.services.translation.translationservice import \
      TranslationService
 from zope.app.services.translation.messagecatalog import \
@@ -34,6 +34,13 @@
 from zope.publisher.http import HTTPCharsets
 from zope.publisher.browser import BrowserRequest
 
+class Translate(Translate):
+    """Make Translate a valid Browser view. Usually done by ZCML."""
+
+    def __init__(self, context, request):
+        self.context = context
+        self.request = request
+        
 
 class TranslateTest(unittest.TestCase, PlacelessSetup):