Ejemplo n.º 1
0
 def test_to_dict(self):
     expected_object_dict = {
         'question_id': 'testquestion',
         'skill_id': 'testskill',
     }
     observed_object = question_domain.QuestionSkillLink(
         'testquestion', 'testskill')
     self.assertEqual(expected_object_dict, observed_object.to_dict())
Ejemplo n.º 2
0
 def test_to_dict(self):
     """Test to verify to_dict method of the Question Skill Link Domain
     object.
     """
     expected_object_dict = {
         'question_id': 'testquestion',
         'skill_id': 'testskill',
     }
     observed_object = question_domain.QuestionSkillLink(
         'testquestion', 'testskill')
     self.assertEqual(expected_object_dict, observed_object.to_dict())
Ejemplo n.º 3
0
def get_question_skill_link_from_model(question_skill_link_model,
                                       skill_description):
    """Returns domain object representing the given question skill link model.

    Args:
        question_skill_link_model: QuestionSkillLinkModel. The question skill
            link model loaded from the datastore.
        skill_description: str. The description of skill linked to question.

    Returns:
        QuestionSkillLink. The domain object representing the question skill
            link model.
    """

    return question_domain.QuestionSkillLink(
        question_skill_link_model.question_id,
        question_skill_link_model.skill_id, skill_description)