Exemplo n.º 1
0
 def test_march30_minus_1(self):
     # 1 month before March 30 is February 28
     self.assertEqual(Member.add_n_months(date(2015, 3, 30), -1),
                      date(2015, 2, 28))
     # or February 29
     self.assertEqual(Member.add_n_months(date(2016, 3, 30), -1),
                      date(2016, 2, 29))
Exemplo n.º 2
0
 def test_march30_minus_1(self):
     # 1 month before March 30 is February 28
     self.assertEqual(Member.add_n_months(date(2015, 3, 30), -1),
                      date(2015, 2, 28))
     # or February 29
     self.assertEqual(Member.add_n_months(date(2016, 3, 30), -1),
                      date(2016, 2, 29))
Exemplo n.º 3
0
 def test_dec30_plus_2(self):
     # 2 months after December 30 is February 28
     self.assertEqual(Member.add_n_months(date(2014, 12, 30), 2),
                      date(2015, 2, 28))
     # or February 29
     self.assertEqual(Member.add_n_months(date(2015, 12, 30), 2),
                      date(2016, 2, 29))
Exemplo n.º 4
0
 def test_dec30_plus_2(self):
     # 2 months after December 30 is February 28
     self.assertEqual(Member.add_n_months(date(2014, 12, 30), 2),
                      date(2015, 2, 28))
     # or February 29
     self.assertEqual(Member.add_n_months(date(2015, 12, 30), 2),
                      date(2016, 2, 29))
Exemplo n.º 5
0
 def test_dec31_minus_1(self):
     # 1 month before December 31 is November 30
     self.assertEqual(Member.add_n_months(date(2015, 12, 31), -1),
                      date(2015, 11, 30))
Exemplo n.º 6
0
 def test_jan1_minus_1(self):
     # 1 month before January 1 is December 1
     self.assertEqual(Member.add_n_months(date(2015, 1, 1), -1),
                      date(2014, 12, 1))
Exemplo n.º 7
0
 def test_jan1_plus_12(self):
     # 12 months after January 1 is January 1 next year
     self.assertEqual(Member.add_n_months(date(2015, 1, 1), 12),
                      date(2016, 1, 1))
Exemplo n.º 8
0
 def test_dec1_plus_2(self):
     # 2 months after December 1 is February 1
     self.assertEqual(Member.add_n_months(date(2014, 12, 1), 2),
                      date(2015, 2, 1))
Exemplo n.º 9
0
 def test_jan1_plus_2(self):
     # 2 months after January 1 is March 1
     self.assertEqual(Member.add_n_months(date(2015, 1, 1), 2),
                      date(2015, 3, 1))
Exemplo n.º 10
0
 def test_jan30_plus_1(self):
     # 1 month after January 30 is February 28
     self.assertEqual(Member.add_n_months(date(2015, 1, 30), 1),
                      date(2015, 2, 28))
Exemplo n.º 11
0
 def test_jan30_plus_1(self):
     # 1 month after January 30 is February 28
     self.assertEqual(Member.add_n_months(date(2015, 1, 30), 1),
                      date(2015, 2, 28))
Exemplo n.º 12
0
 def test_march1_minus_1(self):
     # 1 month before March 1 is February 1
     self.assertEqual(Member.add_n_months(date(2015, 3, 1), -1),
                      date(2015, 2, 1))
Exemplo n.º 13
0
 def test_march1_minus_1(self):
     # 1 month before March 1 is February 1
     self.assertEqual(Member.add_n_months(date(2015, 3, 1), -1),
                      date(2015, 2, 1))
Exemplo n.º 14
0
 def test_dec31_minus_1(self):
     # 1 month before December 31 is November 30
     self.assertEqual(Member.add_n_months(date(2015, 12, 31), -1),
                      date(2015, 11, 30))
Exemplo n.º 15
0
 def test_jan1_minus_1(self):
     # 1 month before January 1 is December 1
     self.assertEqual(Member.add_n_months(date(2015, 1, 1), -1),
                      date(2014, 12, 1))
Exemplo n.º 16
0
 def test_jan1_plus_12(self):
     # 12 months after January 1 is January 1 next year
     self.assertEqual(Member.add_n_months(date(2015, 1, 1), 12),
                      date(2016, 1, 1))
Exemplo n.º 17
0
 def test_dec1_plus_2(self):
     # 2 months after December 1 is February 1
     self.assertEqual(Member.add_n_months(date(2014, 12, 1), 2),
                      date(2015, 2, 1))
Exemplo n.º 18
0
 def test_jan1_plus_2(self):
     # 2 months after January 1 is March 1
     self.assertEqual(Member.add_n_months(date(2015, 1, 1), 2),
                      date(2015, 3, 1))
Exemplo n.º 19
0
 def test_jan1_plus_1(self):
     # 1 month after January 1 is February 1
     self.assertEqual(Member.add_n_months(date(2015, 1, 1), 1),
                      date(2015, 2, 1))
Exemplo n.º 20
0
 def test_jan1_plus_1(self):
     # 1 month after January 1 is February 1
     self.assertEqual(Member.add_n_months(date(2015, 1, 1), 1),
                      date(2015, 2, 1))