本文整理汇总了Python中test_utils.RequestFactory.LANGUAGE_CODE方法的典型用法代码示例。如果您正苦于以下问题:Python RequestFactory.LANGUAGE_CODE方法的具体用法?Python RequestFactory.LANGUAGE_CODE怎么用?Python RequestFactory.LANGUAGE_CODE使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类test_utils.RequestFactory
的用法示例。
在下文中一共展示了RequestFactory.LANGUAGE_CODE方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_german
# 需要导入模块: from test_utils import RequestFactory [as 别名]
# 或者: from test_utils.RequestFactory import LANGUAGE_CODE [as 别名]
def test_german(self):
"""GepIP code is not included when the locale is de."""
req = RequestFactory()
req.LANGUAGE_CODE = 'de'
val = geoip_cache_detector(req)
eq_(val['include_geoip'], False)
示例2: setUp
# 需要导入模块: from test_utils import RequestFactory [as 别名]
# 或者: from test_utils.RequestFactory import LANGUAGE_CODE [as 别名]
def setUp(self):
super(MockRequestTests, self).setUp()
request = RequestFactory()
request.GET = {}
request.LANGUAGE_CODE = 'en-US'
self.request = request
示例3: test_english
# 需要导入模块: from test_utils import RequestFactory [as 别名]
# 或者: from test_utils.RequestFactory import LANGUAGE_CODE [as 别名]
def test_english(self):
"""GepIP code is included when the locale is en-US."""
req = RequestFactory()
req.LANGUAGE_CODE = 'en-US'
val = geoip_cache_detector(req)
eq_(val['include_geoip'], True)