l.a.t.QuestionFactory : class documentation

Part of lp.answers.testing View In Hierarchy

Helper object that can be used to quickly create questions.
Class Method createManyByProject Create a number of questions on selected projects.
Class Method createManyByTarget Create a number of questions on a selected target
Class Method _getQuestionTarget Return the IQuestionTarget to use.
@classmethod
def _getQuestionTarget(cls, target_name):
Return the IQuestionTarget to use.

It returns the pillar with the target_name and makes sure it provides IQuestionTarget.

@classmethod
def createManyByProject(cls, specification):
Create a number of questions on selected projects.

The function expects a sequence of tuples of the form (project_name, question_count).

project_name should be the name of a pillar providing IQuestionTarget.

question_count is the number of questions to create on the target.

Questions will appear as posted by the currently logged in user.

@classmethod
def createManyByTarget(cls, target, question_count):
Create a number of questions on a selected target

Questions will appear as posted by the currently logged in user.

Parametersquestion_countThe number of questions to create on the target.
API Documentation for Launchpad, generated by pydoctor at 2022-06-16 00:00:12.