def get_answer_messages(snip): a1 = Answer(snip=snip) a2 = Answer(snip=snip) a1.save() a2.save() return get_answer_message(a1), get_answer_message(a2)
def test_build_moderation_request_message_body(): u = User() u.save() c = Conversation(user=u) c.save() s1 = Snip(conversation=c,prompt='Hello Mr. Quibbles',sequence=0,complete=True) s1.save() a1 = Answer(snip=s1,text='Hello User.') a1.save() m1 = Moderated(snip=s1,text='moderated Hello User.') m1.save() s2 = Snip(conversation=c,prompt='Are you people?',sequence=1) s2.save() a2 = Answer(snip=s2,text='Skynet is people.') a2.save() a3 = Answer(snip=s2,text='I am Skynet.') a3.save() moderation_request_message = build_mod_request_message_body(s2)
def test_get_answer_message(): u = User() u.save() c = Conversation(user=u) c.save() s1 = Snip(conversation=c,prompt='Hello Mr. Quibbles',sequence=0,complete=True) s1.save() a1 = Answer(snip=s1,text='Hello User.') a1.save() m1 = Moderated(snip=s1,text='moderated Hello User.') m1.save() s2 = Snip(conversation=c,prompt='Are you people?',sequence=1) s2.save() a2 = Answer(snip=s2) a2.save() answer_message = get_answer_message(a2)