Exemple #1
0
    def testMommyPaymentDelayExcluding(self):
        G(Attendee, event=self.attendance_event, user=self.user)
        not_paid = PaymentReminder.not_paid(self.event_payment)

        self.assertEqual([self.user], not_paid)

        G(PaymentDelay,
          payment=self.event_payment,
          user=self.user,
          valid_to=timezone.now() + timedelta(days=1))

        not_paid = PaymentReminder.not_paid(self.event_payment)

        self.assertFalse(not_paid)
Exemple #2
0
    def testEventMommyPaid(self):
        G(Attendee, event=self.attendance_event, user=self.user)
        G(PaymentRelation,
          payment=self.event_payment,
          user=self.user,
          payment_price=self.payment_price)
        not_paid = PaymentReminder.not_paid(self.event_payment)

        self.assertFalse(not_paid)
Exemple #3
0
    def testEventMommyNotPaid(self):
        user1 = G(User)
        user2 = G(User)
        G(Attendee, event=self.attendance_event, user=user1)
        G(Attendee, event=self.attendance_event, user=user2)
        self.simulate_user_payment(user1)

        not_paid = PaymentReminder.not_paid(self.event_payment)

        self.assertEqual([user2], not_paid)
Exemple #4
0
    def test_event_mommy_paid(self):
        user1 = G(User)
        user2 = G(User)
        G(Attendee, event=self.attendance_event, user=user1)
        G(Attendee, event=self.attendance_event, user=user2)
        self.simulate_user_payment(user1)
        self.simulate_user_payment(user2)

        not_paid = PaymentReminder.not_paid(self.event_payment)

        self.assertFalse(not_paid)
Exemple #5
0
    def testEventMommyPaidWithDelays(self):
        user1 = G(User)
        user2 = G(User)
        user3 = G(User)
        G(Attendee, event=self.attendance_event, user=user1)
        G(Attendee, event=self.attendance_event, user=user2)
        G(Attendee, event=self.attendance_event, user=user3)
        G(PaymentDelay,
          payment=self.event_payment,
          user=user2,
          valid_to=timezone.now() + timedelta(days=1))
        self.simulate_user_payment(user3)

        not_paid = PaymentReminder.not_paid(self.event_payment)

        self.assertEqual([user1], not_paid)
Exemple #6
0
    def testEventMommyNotPaidMailAddress(self):
        G(Attendee, event=self.attendance_event, user=self.user)
        not_paid_email = PaymentReminder.not_paid_mail_addresses(
            self.event_payment)

        self.assertEqual([self.user.email], not_paid_email)
Exemple #7
0
    def testEventMommyNotPaid(self):
        G(Attendee, event=self.attendance_event, user=self.user)
        attendees = [attendee.user for attendee in Attendee.objects.all()]
        not_paid = PaymentReminder.not_paid(self.event_payment)

        self.assertEqual(attendees, not_paid)