def test_answer_question(): u = User.create(user_id=uuid4()) root = Category.get_root() cat = root.create_sub("monkey") question = Question.create(category=cat, text="test question", user=u) answer = Answer.create(user=u, question=question, text="monkey") u2 = User.create(user_id=uuid4()) answer.vote(u2, 1)
def answer(self, user, text): answer = Answer.create(user, self, text) return answer