|
13 | 13 |
|
14 | 14 | class CalculatePaidUntilTestCase(TestCase): |
15 | 15 | def test_monthly_cycle(self): |
16 | | - mp_purchase = json.loads( |
17 | | - """ |
| 16 | + mp_purchase = json.loads(""" |
18 | 17 | { |
19 | 18 | "account":{ |
20 | 19 | "type":"Organization", |
@@ -42,17 +41,15 @@ def test_monthly_cycle(self): |
42 | 41 | ] |
43 | 42 | } |
44 | 43 | } |
45 | | -""".strip() |
46 | | - ) |
| 44 | +""".strip()) |
47 | 45 | effective_date = datetime(2019, 4, 1, 0, 0, 0, 0) |
48 | 46 | paid_until = utils.calculate_paid_until(mp_purchase, effective_date) |
49 | 47 | expected = datetime(2019, 5, 2, 23, 59, 59, 0) # 31 days |
50 | 48 |
|
51 | 49 | self.assertEqual(paid_until, expected) |
52 | 50 |
|
53 | 51 | def test_yearly_cycle(self): |
54 | | - mp_purchase = json.loads( |
55 | | - """ |
| 52 | + mp_purchase = json.loads(""" |
56 | 53 | { |
57 | 54 | "account":{ |
58 | 55 | "type":"Organization", |
@@ -80,17 +77,15 @@ def test_yearly_cycle(self): |
80 | 77 | ] |
81 | 78 | } |
82 | 79 | } |
83 | | -""".strip() |
84 | | - ) |
| 80 | +""".strip()) |
85 | 81 | effective_date = datetime(2019, 4, 1, 0, 0, 0, 0) |
86 | 82 | paid_until = utils.calculate_paid_until(mp_purchase, effective_date) |
87 | 83 | expected = datetime(2020, 4, 1, 23, 59, 59, 0) # 366 days |
88 | 84 |
|
89 | 85 | self.assertEqual(paid_until, expected) |
90 | 86 |
|
91 | 87 | def test_custom_billing_cycle(self): |
92 | | - mp_purchase = json.loads( |
93 | | - """ |
| 88 | + mp_purchase = json.loads(""" |
94 | 89 | { |
95 | 90 | "account":{ |
96 | 91 | "type":"Organization", |
@@ -118,8 +113,7 @@ def test_custom_billing_cycle(self): |
118 | 113 | ] |
119 | 114 | } |
120 | 115 | } |
121 | | -""".strip() |
122 | | - ) |
| 116 | +""".strip()) |
123 | 117 | effective_date = datetime(2025, 9, 25, 0, 0, 0, 0) |
124 | 118 | paid_until = utils.calculate_paid_until( |
125 | 119 | mp_purchase, effective_date, datetime(2027, 9, 25, 0, 0, 0, 0) |
|
0 commit comments