Back to index

plone3  3.1.7
Public Member Functions | Public Attributes
CMFPlone.tests.testTranslationServiceTool.TestUTranslate Class Reference
Inheritance diagram for CMFPlone.tests.testTranslationServiceTool.TestUTranslate:
Inheritance graph
[legend]
Collaboration diagram for CMFPlone.tests.testTranslationServiceTool.TestUTranslate:
Collaboration graph
[legend]

List of all members.

Public Member Functions

def afterSetUp
def testUTranslate
def setRequestMethod
def getAuthenticator
def setupAuthenticator

Public Attributes

 tool

Detailed Description

Definition at line 9 of file testTranslationServiceTool.py.


Member Function Documentation

Definition at line 11 of file testTranslationServiceTool.py.

00011 
00012     def afterSetUp(self):
00013         self.tool = getToolByName(self.portal, 'translation_service')

Definition at line 30 of file PloneTestCase.py.

00030 
00031     def getAuthenticator(self):
00032         tag = AuthenticatorView('context', 'request').authenticator()
00033         pattern = '<input .*name="(\w+)".*value="(\w+)"'
00034         return match(pattern, tag).groups()

Here is the call graph for this function:

Here is the caller graph for this function:

def CMFPlone.tests.PloneTestCase.PloneTestCase.setRequestMethod (   self,
  method 
) [inherited]
This is a stub now, but in case you want to try
   something fancy on Your Branch (tm), put it here.

Definition at line 26 of file PloneTestCase.py.

00026 
00027     def setRequestMethod(self, method):
00028         self.app.REQUEST.set('REQUEST_METHOD', method)
00029         self.app.REQUEST.method = method

Here is the caller graph for this function:

Definition at line 35 of file PloneTestCase.py.

00035 
00036     def setupAuthenticator(self):
00037         name, token = self.getAuthenticator()
00038         self.app.REQUEST.form[name] = token
00039 

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 14 of file testTranslationServiceTool.py.

00014 
00015     def testUTranslate(self):
00016         # Test Unicode value
00017         value = self.tool.utranslate('domain', u'foo')
00018         self.assertEquals(value, u'foo')
00019 
00020         # Test ascii value
00021         value = self.tool.utranslate('domain', 'foo')
00022         self.assertEquals(value, u'foo')
00023 
00024         # Test utf-8 value
00025         value = self.tool.utranslate('domain', u'\xc3'.encode('utf-8'))
00026         self.assertEquals(value, u'\xc3')
00027 
00028         # Test empty string
00029         value = self.tool.utranslate('domain', '')
00030         self.assertEquals(value, u'')
00031 
00032         # Test empty domain
00033         value = self.tool.utranslate('', 'foo')
00034         self.assertEquals(value, u'foo')
00035 
00036         # Test default is None
00037         value = self.tool.utranslate('domain', 'foo', default=None)
00038         self.assertEquals(value, u'foo')

Here is the call graph for this function:


Member Data Documentation

Definition at line 12 of file testTranslationServiceTool.py.


The documentation for this class was generated from the following file: