本文整理匯總了Python中xblock.fields.Boolean方法的典型用法代碼示例。如果您正苦於以下問題:Python fields.Boolean方法的具體用法?Python fields.Boolean怎麽用?Python fields.Boolean使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類xblock.fields
的用法示例。
在下文中一共展示了fields.Boolean方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: test_i18n
# 需要導入模塊: from xblock import fields [as 別名]
# 或者: from xblock.fields import Boolean [as 別名]
def test_i18n(self):
"""
Test that field names and help text get translated using the XBlock runtime's ugettext
method.
"""
with mock.patch.object(FancyXBlock, "ugettext", side_effect=lambda text: text[::-1]):
self.set_up_root_block()
bool_field = self.browser.find_element_by_css_selector('li[data-field-name=bool_normal]')
self.assertIn("Normal Boolean Field"[::-1], bool_field.text)
string_with_help_field = self.browser.find_element_by_css_selector('li[data-field-name=string_with_help]')
self.assertIn("Learn more about"[::-1], string_with_help_field.text)