Back to index

plone3  3.1.7
Functions
plone.i18n.locales.tests.test_cctlds Namespace Reference

Functions

def configurationSetUp
def testccTLDs
def test_suite

Function Documentation

Definition at line 19 of file test_cctlds.py.

00019 
00020 def configurationSetUp(self):
00021     setUp()
00022     XMLConfig('meta.zcml', zope.component)()
00023     XMLConfig('meta.zcml', zope.app.publisher.browser)()
00024     XMLConfig('configure.zcml', plone.i18n.locales)()

Here is the call graph for this function:

Definition at line 49 of file test_cctlds.py.

00049 
00050 def test_suite():
00051     return unittest.TestSuite((
00052         DocTestSuite('plone.i18n.locales.cctld'),
00053         DocTestSuite(setUp=configurationSetUp,
00054                      tearDown=tearDown,
00055                      optionflags=doctest.ELLIPSIS | doctest.NORMALIZE_WHITESPACE),
00056         ))

  >>> util = queryUtility(ICcTLDInformation)
  >>> util
  <plone.i18n.locales.cctld.CcTLDInformation object at ...>

  >>> tlds = util.getAvailableTLDs()
  >>> len(tlds)
  266

  >>> u'nl' in tlds
  True

  >>> tlds = util.getTLDs()
  >>> len(tlds)
  266

  >>> util.getLanguagesForTLD(u'nl')
  [u'nl']

  >>> util.getLanguagesForTLD(u'be')
  [u'nl', u'fr']

Definition at line 25 of file test_cctlds.py.

00025 
00026 def testccTLDs():
00027     """
00028       >>> util = queryUtility(ICcTLDInformation)
00029       >>> util
00030       <plone.i18n.locales.cctld.CcTLDInformation object at ...>
00031 
00032       >>> tlds = util.getAvailableTLDs()
00033       >>> len(tlds)
00034       266
00035 
00036       >>> u'nl' in tlds
00037       True
00038 
00039       >>> tlds = util.getTLDs()
00040       >>> len(tlds)
00041       266
00042 
00043       >>> util.getLanguagesForTLD(u'nl')
00044       [u'nl']
00045 
00046       >>> util.getLanguagesForTLD(u'be')
00047       [u'nl', u'fr']
00048     """