Example #1
0
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)
Example #2
0
 def get_answers(self, offset_answer=None, limit=None):
     answers = Answer.objects(question_id=self.question_id)
     return answers
Example #3
0
 def answer(self, user, text):
     answer = Answer.create(user, self, text)
     return answer
Example #4
0
 def get_answers(self, offset_answer=None, limit=None):
     answers = Answer.objects(question_id=self.question_id)
     return answers
Example #5
0
 def answer(self, user, text):
     answer = Answer.create(user, self, text)
     return answer