[Checkins] SVN: five.pt/trunk/src/five/pt/tests/ Need to register a translation domain to reproduce the MissingValue
Ross Patterson
me at rpatterson.net
Sat Oct 23 19:14:42 EDT 2010
Log message for revision 117828:
Need to register a translation domain to reproduce the MissingValue
error: LP#649343
Changed:
U five.pt/trunk/src/five/pt/tests/missing.pt
U five.pt/trunk/src/five/pt/tests/test_viewpagetemplatefile.py
-=-
Modified: five.pt/trunk/src/five/pt/tests/missing.pt
===================================================================
--- five.pt/trunk/src/five/pt/tests/missing.pt 2010-10-23 23:13:52 UTC (rev 117827)
+++ five.pt/trunk/src/five/pt/tests/missing.pt 2010-10-23 23:14:42 UTC (rev 117828)
@@ -1,6 +1,8 @@
<div xmlns="http://www.w3.org/1999/xhtml"
- xmlns:tal="http://xml.zope.org/namespaces/tal">
- <span tal:content="structure options/missing">
+ xmlns:tal="http://xml.zope.org/namespaces/tal"
+ xmlns:i18n="http://xml.zope.org/namespaces/i18n"
+ i18n:domain="test">
+ <span tal:content="options/missing">
MV
</span>
</div>
Modified: five.pt/trunk/src/five/pt/tests/test_viewpagetemplatefile.py
===================================================================
--- five.pt/trunk/src/five/pt/tests/test_viewpagetemplatefile.py 2010-10-23 23:13:52 UTC (rev 117827)
+++ five.pt/trunk/src/five/pt/tests/test_viewpagetemplatefile.py 2010-10-23 23:14:42 UTC (rev 117828)
@@ -80,9 +80,20 @@
self.failUnless("c : abc" in result)
def test_MissingValue(self):
- view = MissingView(self.folder, self.folder.REQUEST)
+ request = self.folder.REQUEST
+ view = MissingView(self.folder, request)
+
+ from zope.component import provideUtility
+ from zope.i18n.interfaces import ITranslationDomain
+ from zope.i18n.simpletranslationdomain import SimpleTranslationDomain
+ pfp = SimpleTranslationDomain('test', {})
+ provideUtility(pfp, ITranslationDomain, name='test')
+
import Missing
+ request["LANGUAGE"] = 'en'
result = view.index(missing=Missing.MV)
+ del request.other["LANGUAGE"]
+
self.failUnless('<span></span>' in result)
More information about the checkins
mailing list