Example #1
0
    def test_can_lookup_messages_by_story_or_group(self):
        start_message = 'start {}'.format(self.story_code.word_string)
        send_message(start_message)
        group = Group.query().get()

        answer_text = 'my answer is 42'
        status, response = send_message(answer_text)
        self.assertEqual(200, status)
        self.maxDiff = None
        self.assertIn(self.next_clue.text, response)
        expected_messages = [start_message, INTRO_INSTRUCTIONS.text, self.start_clue.text,
                             answer_text, self.next_clue.text]
        self.assertItemsEqual(expected_messages, [m.text for m in Message.for_story(self.story.uid)])
        self.assertItemsEqual(expected_messages, [m.text for m in Message.for_group(group.uid)])
Example #2
0
 def test_completion_sets_group_completed_time(self):
     status, response = send_message('start {}'.format(self.story_code.word_string))
     status, response = send_message('my answer is 42')
     group = Group.query().get()
     self.assertIsNotNone(group.completed_at)