def test_all_data(self): eval_id = Evaluation.create("Evaluation Create Test", self.card_id).id() EvalItemData.create_or_update(self.item1_id, eval_id, "Item 1 Value") EvalItemData.create_or_update(self.item2_id, eval_id, "Item 2 Value") CommentData.create_or_update(eval_id, "Comments") TextLineData.create_or_update(self.text_line1_id, eval_id, "Text Line 1 Value") all_data = Evaluation.find_by_id(eval_id).all_data() self.assertEqual("Item 1 Value", all_data["items"][self.item1_id]) self.assertEqual("Item 2 Value", all_data["items"][self.item2_id]) self.assertEqual("", all_data["items"][self.item3_id]) self.assertEqual("Comments", all_data["comments"]) self.assertEqual("Text Line 1 Value", all_data["text"][self.text_line1_id]) self.assertEqual("", all_data["text"][self.text_line2_id])
def test_create_or_update(self): first_id = CommentData.create_or_update(self.evaluation_id, 'Comment Data Test Comment').id() second_id = CommentData.create_or_update(self.evaluation_id, 'Comment Data Test Comment Updated').id() self.assertEqual(first_id, second_id) comment_data = CommentData.find_by_id(second_id) self.assertEqual('Comment Data Test Comment Updated', comment_data.value)