Пример #1
0
    def test_begin_payment_next_month(self):
        iterator = financing.iter_regular_month(self.regular,
                                                date_start=datetime(
                                                    2015, 3, 16))
        payment = next(iterator)
        self.assertEqual(payment['date'], datetime(2015, 4, 15))

        iterator = financing.iter_regular_month(self.regular,
                                                date_start=datetime(
                                                    2016, 3, 16))
        self.assertRaises(StopIteration, next, iterator)
Пример #2
0
 def test_proper_sequence(self):
     iterator = financing.iter_regular_month(self.regular,
                                             date_start=datetime(
                                                 2015, 3, 20))
     payment = next(iterator)
     self.assertEqual(payment['date'], datetime(2015, 4, 15))
     payment = next(iterator)
     self.assertEqual(payment['date'], datetime(2015, 5, 15))
     self.assertRaises(StopIteration, next, iterator)
Пример #3
0
 def test_begin_payment_this_month(self):
     iterator = financing.iter_regular_month(self.regular,
                                             date_start=datetime(
                                                 2015, 3, 15))
     payment = next(iterator)
     self.assertEqual(payment['date'], datetime(2015, 3, 15))
Пример #4
0
 def test_begin_payment_next_year(self):
     iterator = financing.iter_regular_month(self.infinite,
                                             date_start=datetime(
                                                 2016, 3, 16))
     payment = next(iterator)
     self.assertEqual(payment['date'], datetime(2016, 4, 15))
Пример #5
0
 def test_last_calender_day(self):
     iterator = financing.iter_regular_month(self.lastcal,
                                             date_start=datetime(
                                                 2015, 2, 28))
     payment = next(iterator)
     self.assertEqual(payment['date'], datetime(2015, 2, 28))