本文整理汇总了Python中models.Question.get_sample_questions方法的典型用法代码示例。如果您正苦于以下问题:Python Question.get_sample_questions方法的具体用法?Python Question.get_sample_questions怎么用?Python Question.get_sample_questions使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类models.Question
的用法示例。
在下文中一共展示了Question.get_sample_questions方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_multiple_dimensions
# 需要导入模块: from models import Question [as 别名]
# 或者: from models.Question import get_sample_questions [as 别名]
def test_multiple_dimensions(self):
"""Match against multiple dimensions"""
questions = Question.get_sample_questions('language', 'urls')
self.assertEquals(len(questions), 2)
示例2: test_one_dimension
# 需要导入模块: from models import Question [as 别名]
# 或者: from models.Question import get_sample_questions [as 别名]
def test_one_dimension(self):
"""With a dimension that matches one question"""
questions = Question.get_sample_questions('hashtags')
self.assertEquals(len(questions), 1)
示例3: test_one_dimension_multi_match
# 需要导入模块: from models import Question [as 别名]
# 或者: from models.Question import get_sample_questions [as 别名]
def test_one_dimension_multi_match(self):
"""Try matching a dimension with multiple questions"""
questions = Question.get_sample_questions('language')
self.assertEquals(len(questions), 2)
示例4: test_no_dimensions
# 需要导入模块: from models import Question [as 别名]
# 或者: from models.Question import get_sample_questions [as 别名]
def test_no_dimensions(self):
"""When you don't request any dimensions it returns all the questions"""
questions = Question.get_sample_questions()
self.assertEquals(len(questions), 3)