Back to index

plone3  3.1.7
Public Member Functions | Public Attributes
PloneLanguageTool.tests.test_languagetool.TestLanguageTool Class Reference

List of all members.

Public Member Functions

def afterSetUp
def testLanguageSettings
def testSupportedLanguages
def testDefaultLanguage
def testAvailableLanguage

Public Attributes

 id
 ltool

Detailed Description

Definition at line 46 of file test_languagetool.py.


Member Function Documentation

Definition at line 48 of file test_languagetool.py.

00048 
00049     def afterSetUp(self):
00050         self.id = LanguageTool.id
00051         self.ltool = self.portal._getOb(self.id)

Definition at line 86 of file test_languagetool.py.

00086 
00087     def testAvailableLanguage(self):
00088         defaultLanguage = 'de'
00089         supportedLanguages = ['en','de','no']
00090         self.ltool.manage_setLanguageSettings(defaultLanguage, supportedLanguages)
00091         availableLanguages = self.ltool.getAvailableLanguageInformation()
00092         for lang in availableLanguages:
00093             if lang in supportedLanguages:
00094                 self.failUnless(availableLanguages[lang]['selected'] == True)
00095 

Definition at line 73 of file test_languagetool.py.

00073 
00074     def testDefaultLanguage(self):
00075         supportedLanguages = ['de','no']
00076 
00077         self.ltool.manage_setLanguageSettings('no', supportedLanguages)
00078         self.failUnless(self.ltool.getSupportedLanguages()==supportedLanguages)
00079         self.failUnless(self.ltool.getDefaultLanguage()=='no')
00080 
00081         # default not in supported languages, should set to first supported
00082         self.ltool.manage_setLanguageSettings('nl', supportedLanguages)
00083 
00084         self.failUnless(self.ltool.getSupportedLanguages()==supportedLanguages)
00085         self.failUnless(self.ltool.getDefaultLanguage()=='de')

Definition at line 52 of file test_languagetool.py.

00052 
00053     def testLanguageSettings(self):
00054         defaultLanguage = 'de'
00055         supportedLanguages = ['en','de','no']
00056         self.ltool.manage_setLanguageSettings(defaultLanguage, supportedLanguages,
00057                                               setUseCombinedLanguageCodes=False)
00058         self.failUnless(self.ltool.getDefaultLanguage()==defaultLanguage)
00059         self.failUnless(self.ltool.getSupportedLanguages()==supportedLanguages)

Definition at line 60 of file test_languagetool.py.

00060 
00061     def testSupportedLanguages(self):
00062         defaultLanguage = 'de'
00063         supportedLanguages = ['en','de','no']
00064         self.ltool.manage_setLanguageSettings(defaultLanguage, supportedLanguages)
00065         self.failUnless(self.ltool.getSupportedLanguages()==supportedLanguages)
00066 
00067         self.ltool.removeSupportedLanguages(supportedLanguages)
00068         self.failUnless(self.ltool.getSupportedLanguages()==[])
00069 
00070         for lang in supportedLanguages:
00071             self.ltool.addSupportedLanguage(lang)
00072         self.failUnless(self.ltool.getSupportedLanguages()==supportedLanguages)


Member Data Documentation

Definition at line 49 of file test_languagetool.py.

Definition at line 50 of file test_languagetool.py.


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