Back to index

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

Functions

def configurationSetUp
def testAvailableCountries
def test_suite

Function Documentation

Definition at line 19 of file test_countries.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 57 of file test_countries.py.

00057 
00058 def test_suite():
00059     return unittest.TestSuite((
00060         DocTestSuite('plone.i18n.locales.countries'),
00061         DocTestSuite(setUp=configurationSetUp,
00062                      tearDown=tearDown,
00063                      optionflags=doctest.ELLIPSIS | doctest.NORMALIZE_WHITESPACE),
00064         ))

  >>> util = queryUtility(ICountryAvailability)
  >>> util
  <plone.i18n.locales.countries.CountryAvailability object at ...>

  >>> countrycodes = util.getAvailableCountries()
  >>> len(countrycodes)
  243

  >>> u'de' in countrycodes
  True

  >>> countries = util.getCountries()
  >>> len(countries)
  243

  >>> de = countries[u'de']
  >>> de[u'name']
  u'Germany'

  >>> de[u'flag']
  u'/++resource++country-flags/de.gif'

  >>> countries = util.getCountryListing()
  >>> len(countries)
  243

  >>> (u'de', u'Germany') in countries
  True

Definition at line 25 of file test_countries.py.

00025 
00026 def testAvailableCountries():
00027     """
00028       >>> util = queryUtility(ICountryAvailability)
00029       >>> util
00030       <plone.i18n.locales.countries.CountryAvailability object at ...>
00031 
00032       >>> countrycodes = util.getAvailableCountries()
00033       >>> len(countrycodes)
00034       243
00035 
00036       >>> u'de' in countrycodes
00037       True
00038 
00039       >>> countries = util.getCountries()
00040       >>> len(countries)
00041       243
00042 
00043       >>> de = countries[u'de']
00044       >>> de[u'name']
00045       u'Germany'
00046 
00047       >>> de[u'flag']
00048       u'/++resource++country-flags/de.gif'
00049 
00050       >>> countries = util.getCountryListing()
00051       >>> len(countries)
00052       243
00053 
00054       >>> (u'de', u'Germany') in countries
00055       True
00056     """