Example #1
0
    def testMommyEveryoneAttendend(self):
        G(Attendee, event=self.attendance_event, user=self.user, attended=True)
        self.attendance_event.marks_has_been_set = False
        self.attendance_event.automatically_set_marks = True
        self.event.event_end = timezone.now() - datetime.timedelta(days=1)
        self.attendance_event.save()
        self.event.save()

        SetEventMarks.setMarks(self.attendance_event)

        self.assertTrue(self.attendance_event.marks_has_been_set)
        self.assertFalse(MarkUser.objects.all())
Example #2
0
    def testMommySetMarks(self):
        self.attendee.attended = False
        self.attendee.save()
        self.attendance_event.marks_has_been_set = False
        self.attendance_event.automatically_set_marks = True
        self.event.event_end = timezone.now() - datetime.timedelta(days=1)
        self.attendance_event.save()
        self.event.save()

        SetEventMarks.setMarks(self.attendance_event)

        self.assertTrue(self.attendance_event.marks_has_been_set)
        self.assertEqual(self.user, MarkUser.objects.get().user)
Example #3
0
    def testMommyEventNotDone(self):
        self.attendance_event.marks_has_been_set = False
        self.attendance_event.automatically_set_marks = True
        self.event.event_end = timezone.now() + datetime.timedelta(days=1)
        self.attendance_event.save()
        self.event.save()

        self.assertFalse(SetEventMarks.active_events())
Example #4
0
    def testMommyActiveEvents(self):
        self.attendance_event.event.event_end = timezone.now(
        ) - datetime.timedelta(days=1)
        self.attendance_event.event.save()

        self.attendance_event.marks_has_been_set = False
        self.attendance_event.automatically_set_marks = True
        self.attendance_event.save()

        self.assertEqual(self.attendance_event,
                         SetEventMarks.active_events()[0])
Example #5
0
    def testMommyGenerateEmptyMessage(self):
        G(Attendee, event=self.attendance_event, user=self.user, attended=True)
        self.attendance_event.marks_has_been_set = False
        self.attendance_event.automatically_set_marks = True
        self.event.event_end = timezone.now() - datetime.timedelta(days=1)
        self.attendance_event.save()
        self.event.save()

        message = SetEventMarks.generate_message(self.attendance_event)

        self.assertFalse(message.send)
        self.assertFalse(message.results_message)
Example #6
0
    def testMommyGenerateMessage(self):
        self.attendee.attended = False
        self.attendee.save()
        self.attendance_event.marks_has_been_set = False
        self.attendance_event.automatically_set_marks = True
        self.event.event_end = timezone.now() - datetime.timedelta(days=1)
        self.attendance_event.save()
        self.event.save()

        message = SetEventMarks.generate_message(self.attendance_event)

        self.assertTrue(message.send)
        self.assertTrue(message.committee_message)