示例#1
0
文件: test_util.py 项目: 6a68/bedrock
 def test_first_supported_locale_for_language(self):
     """
     If the given locale is not supported, iterate through
     the supported locales and return the first one that
     matches the language.
     """
     eq_(get_fb_like_locale('es-AR'), 'es_ES')
示例#2
0
 def test_first_supported_locale_for_language(self):
     """
     If the given locale is not supported, iterate through
     the supported locales and return the first one that
     matches the language.
     """
     eq_(get_fb_like_locale('es-AR'), 'es_ES')
示例#3
0
def facebook_locale(request):
    return {'facebook_locale': get_fb_like_locale(get_locale(request))}
示例#4
0
 def test_unsupported_locale(self):
     """
     Return the default en_US when locale isn't supported.
     """
     eq_(get_fb_like_locale('zz-ZZ'), 'en_US')
示例#5
0
 def test_supported_locale(self):
     """
     Return the given locale if supported.
     """
     eq_(get_fb_like_locale('en-PI'), 'en_PI')
示例#6
0
 def test_supported_locale(self):
     """
     Return the given locale if supported.
     """
     assert get_fb_like_locale('en-PI') == 'en_PI'
示例#7
0
def facebook_locale(request):
    return {'facebook_locale': get_fb_like_locale(request.locale)}
示例#8
0
文件: test_util.py 项目: 6a68/bedrock
 def test_unsupported_locale(self):
     """
     Return the default en_US when locale isn't supported.
     """
     eq_(get_fb_like_locale('zz-ZZ'), 'en_US')
示例#9
0
文件: test_util.py 项目: 6a68/bedrock
 def test_supported_locale(self):
     """
     Return the given locale if supported.
     """
     eq_(get_fb_like_locale('en-PI'), 'en_PI')
示例#10
0
def facebook_locale(request):
    return {"facebook_locale": get_fb_like_locale(request.locale)}
示例#11
0
 def test_unsupported_locale(self):
     """
     Return the default en_US when locale isn't supported.
     """
     assert get_fb_like_locale("zz-ZZ") == "en_US"
示例#12
0
 def test_supported_locale(self):
     """
     Return the given locale if supported.
     """
     assert get_fb_like_locale('en-PI') == 'en_PI'
示例#13
0
def facebook_locale(request):
    return {"facebook_locale": get_fb_like_locale(get_locale(request))}