| 875 | print "pattern.web.locale.geocode()" |
| 876 | |
| 877 | def test_correlation(self): |
| 878 | # Test the correlation between locale.LANGUAGE_REGION and locale.GEOCODE. |
| 879 | # It should increase as new languages and locations are added. |
| 880 | i = 0 |
| 881 | n = len(web.locale.GEOCODE) |
| 882 | for city, (latitude, longitude, language, region) in web.locale.GEOCODE.items(): |
| 883 | if web.locale.encode_region(region) is not None: |
| 884 | i += 1 |
| 885 | self.assertTrue(float(i) / n > 0.60) |
| 886 | |
| 887 | #--------------------------------------------------------------------------------------------------- |
| 888 | # You need to define a username, password and mailbox to test on. |