Esempio n. 1
0
def comment_dict_to_entity(comment_dict):
    """Converts comment dict to Comment app entity."""
    return entity_factory_common.CommentFactory().create_empty(
        created_at=date_utils.ui_str_with_zone_to_datetime(
            comment_dict["created_at"]),
        description=comment_dict["description"],
        modified_by=email_to_app_person(comment_dict["modified_by"]))
Esempio n. 2
0
 def test_add_comment_to_cycle_task(self, login_as_creator_or_reader,
                                    activated_workflow, selenium):
     """Test adding a comment to the cycle task."""
     cycle_task = cycle_entity_population.create_workflow_cycle(
         activated_workflow).cycle_task_groups[0].cycle_tasks[0]
     comment = entity_factory_common.CommentFactory().create(
         description="comment")
     workflow_ui_facade.add_comment_to_cycle_task(comment=comment,
                                                  cycle_task=cycle_task)
     selenium.refresh()  # reload page to check change is saved
     actual_cycle_task = workflow_ui_facade.get_cycle_task(cycle_task)
     test_utils.set_unknown_attrs_to_none(actual_cycle_task.comments[0])
     test_utils.obj_assert(actual_cycle_task, cycle_task)