def test_no_participant_to_mark(self):
        # make sure a csv with bad PIDS doesn't blow up.
        self._setup_participants()
        self._setup_file(wrong_pid=True)

        with FakeClock(TIME_3):
            exclude_ghost_participants.mark_ghost_participants()
    def test_participant_history_is_updated(self):
        self._setup_participants()
        self._setup_file()

        with FakeClock(TIME_3):
            exclude_ghost_participants.mark_ghost_participants()
        # version 2 should have ghost id flag set.
        history = self.p_history.get([1, 2])
        self.assertEqual(history.isGhostId, 1)
        self.assertEqual(history.dateAddedGhost, TIME_3)
    def test_mark_ghost_participant(self):
        self._setup_participants()
        self._setup_file()

        with FakeClock(TIME_3):
            exclude_ghost_participants.mark_ghost_participants()

        person1 = self.participant_dao.get(self.participant1.participantId)
        person2 = self.participant_dao.get(self.participant2.participantId)
        self.assertEqual(person1.isGhostId, 1)
        self.assertEqual(person1.dateAddedGhost, TIME_3)
        self.assertEqual(person2.isGhostId, 1)
        self.assertEqual(person2.dateAddedGhost, TIME_3)
Пример #4
0
def exclude_ghosts():
  mark_ghost_participants()
  return '{"success": "true"}'