Back to index

plone3  3.1.7
Public Member Functions | Public Attributes
PloneLanguageTool.tests.test_negotiation.TestCcTLDLanguageNegotiation Class Reference
Inheritance diagram for PloneLanguageTool.tests.test_negotiation.TestCcTLDLanguageNegotiation:
Inheritance graph
[legend]
Collaboration diagram for PloneLanguageTool.tests.test_negotiation.TestCcTLDLanguageNegotiation:
Collaboration graph
[legend]

List of all members.

Public Member Functions

def afterSetUp
def checkLanguage
def testSimpleHostname
def testIPAddress
def testDutchDomain
def testAcceptedLanguages
def testMultiLingualCountries

Public Attributes

 basic_auth
 portal_path
 tool

Detailed Description

Definition at line 110 of file test_negotiation.py.


Member Function Documentation

Reimplemented from PloneLanguageTool.tests.test_negotiation.LanguageNegotiationTestCase.

Definition at line 111 of file test_negotiation.py.

00111 
00112     def afterSetUp(self):
00113         LanguageNegotiationTestCase.afterSetUp(self)
00114         self.tool.supported_langs = ['en', 'nl', 'fr']
00115         self.tool.use_cctld_negotiation = 1
00116         self.tool.display_flags = 0

Definition at line 117 of file test_negotiation.py.

00117 
00118     def checkLanguage(self, response, language):
00119         self.assertEquals(response.getStatus(), 200)
00120         self.failUnless('<option selected="selected" value="%s">' % language
00121             in response.getBody())

Here is the caller graph for this function:

Definition at line 138 of file test_negotiation.py.

00138 
00139     def testAcceptedLanguages(self):
00140         # Brazil uses Portugese, which is not in the accepted languages list
00141         response = self.publish(self.portal_path, self.basic_auth,
00142                                 env={'HTTP_HOST': 'plone.br'})
00143         self.checkLanguage(response, "en")

Here is the call graph for this function:

Definition at line 133 of file test_negotiation.py.

00133 
00134     def testDutchDomain(self):
00135         response = self.publish(self.portal_path, self.basic_auth,
00136                                 env={'HTTP_HOST': 'plone.nl'})
00137         self.checkLanguage(response, "nl")

Here is the call graph for this function:

Definition at line 128 of file test_negotiation.py.

00128 
00129     def testIPAddress(self):
00130         response = self.publish(self.portal_path, self.basic_auth,
00131                                 env={'HTTP_HOST': '127.0.0.1'})
00132         self.checkLanguage(response, "en")

Here is the call graph for this function:

Definition at line 144 of file test_negotiation.py.

00144 
00145     def testMultiLingualCountries(self):
00146         # Some countries refuse to pick a single language. Belgium
00147         # uses both Dutch and French, with a preference for Dutch.
00148 
00149         response = self.publish(self.portal_path, self.basic_auth,
00150                                 env={'HTTP_HOST': 'plone.be'})
00151         self.checkLanguage(response, "nl")
00152 
00153         # If we stop allowing Dutch we should now fall back to French
00154         self.tool.supported_langs = ['en', 'fr']
00155         response = self.publish(self.portal_path, self.basic_auth,
00156                                 env={'HTTP_HOST': 'plone.be'})
00157         self.checkLanguage(response, "fr")
00158 

Here is the call graph for this function:

Definition at line 122 of file test_negotiation.py.

00122 
00123     def testSimpleHostname(self):
00124         # For a simple hostname without ccTLD the canonical language is used
00125         response = self.publish(self.portal_path, self.basic_auth,
00126                                 env={'HTTP_HOST': 'localhost'})
00127         self.checkLanguage(response, "en")

Here is the call graph for this function:


Member Data Documentation

Definition at line 16 of file test_negotiation.py.

Definition at line 17 of file test_negotiation.py.

Definition at line 18 of file test_negotiation.py.


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