Back to index

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

List of all members.

Public Member Functions

def afterSetUp
def testLanguageNegotiation

Public Attributes

 basic_auth
 portal_path
 tool

Detailed Description

Definition at line 32 of file test_negotiation.py.


Member Function Documentation

Reimplemented from PloneLanguageTool.tests.test_negotiation.LanguageNegotiationTestCase.

Definition at line 34 of file test_negotiation.py.

00034 
00035     def afterSetUp(self):
00036         LanguageNegotiationTestCase.afterSetUp(self)
00037         # set some allowed languages and make sure we don't use combined
00038         # language codes
00039         self.tool.supported_langs = ['en', 'pt', 'de']
00040         self.tool.use_combined_language_codes = 0
00041         self.tool.display_flags = 0

Definition at line 42 of file test_negotiation.py.

00042 
00043     def testLanguageNegotiation(self):
00044         # Test simple supported codes
00045         response = self.publish(self.portal_path, self.basic_auth,
00046                                 env={'HTTP_ACCEPT_LANGUAGE': 'pt'})
00047 
00048         self.assertEquals(response.getStatus(), 200)
00049         self.failUnless('<option selected="selected" value="pt">'
00050             in response.getBody())
00051 
00052         response = self.publish(self.portal_path, self.basic_auth,
00053                                 env={'HTTP_ACCEPT_LANGUAGE': 'de'})
00054 
00055         self.assertEquals(response.getStatus(), 200)
00056         self.failUnless('<option selected="selected" value="de">'
00057             in response.getBody())
00058 
00059         # Test combined unsupported codes, should fall back
00060         response = self.publish(self.portal_path, self.basic_auth,
00061                                 env={'HTTP_ACCEPT_LANGUAGE': 'pt-br'})
00062 
00063         self.assertEquals(response.getStatus(), 200)
00064         self.failUnless('<option selected="selected" value="pt">'
00065             in response.getBody())
00066 


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: