Skip to content

Commit f25a284

Browse files
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
1 parent 91bf5c3 commit f25a284

5 files changed

Lines changed: 8 additions & 19 deletions

File tree

tcms_github_marketplace/menu.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
from django.urls import reverse_lazy
77
from django.utils.translation import gettext_lazy as _
88

9-
109
# Follows the format of ``tcms.settings.common.MENU_ITEMS``
1110
MENU_ITEMS = [
1211
(_("Subscriptions"), reverse_lazy("github_marketplace_plans")),

tcms_github_marketplace/tests/test_utils.py

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,7 @@
1313

1414
class CalculatePaidUntilTestCase(TestCase):
1515
def test_monthly_cycle(self):
16-
mp_purchase = json.loads(
17-
"""
16+
mp_purchase = json.loads("""
1817
{
1918
"account":{
2019
"type":"Organization",
@@ -42,17 +41,15 @@ def test_monthly_cycle(self):
4241
]
4342
}
4443
}
45-
""".strip()
46-
)
44+
""".strip())
4745
effective_date = datetime(2019, 4, 1, 0, 0, 0, 0)
4846
paid_until = utils.calculate_paid_until(mp_purchase, effective_date)
4947
expected = datetime(2019, 5, 2, 23, 59, 59, 0) # 31 days
5048

5149
self.assertEqual(paid_until, expected)
5250

5351
def test_yearly_cycle(self):
54-
mp_purchase = json.loads(
55-
"""
52+
mp_purchase = json.loads("""
5653
{
5754
"account":{
5855
"type":"Organization",
@@ -80,17 +77,15 @@ def test_yearly_cycle(self):
8077
]
8178
}
8279
}
83-
""".strip()
84-
)
80+
""".strip())
8581
effective_date = datetime(2019, 4, 1, 0, 0, 0, 0)
8682
paid_until = utils.calculate_paid_until(mp_purchase, effective_date)
8783
expected = datetime(2020, 4, 1, 23, 59, 59, 0) # 366 days
8884

8985
self.assertEqual(paid_until, expected)
9086

9187
def test_custom_billing_cycle(self):
92-
mp_purchase = json.loads(
93-
"""
88+
mp_purchase = json.loads("""
9489
{
9590
"account":{
9691
"type":"Organization",
@@ -118,8 +113,7 @@ def test_custom_billing_cycle(self):
118113
]
119114
}
120115
}
121-
""".strip()
122-
)
116+
""".strip())
123117
effective_date = datetime(2025, 9, 25, 0, 0, 0, 0)
124118
paid_until = utils.calculate_paid_until(
125119
mp_purchase, effective_date, datetime(2027, 9, 25, 0, 0, 0, 0)

tcms_github_marketplace/tests/test_views.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,7 @@ def setUpClass(cls):
3939
cls.url = reverse("github_marketplace_purchase_hook")
4040

4141
def test_without_signature_header(self):
42-
payload = json.loads(
43-
"""
42+
payload = json.loads("""
4443
{
4544
"action":"purchased",
4645
"effective_date":"2017-10-25T00:00:00+00:00",
@@ -92,8 +91,7 @@ def test_without_signature_header(self):
9291
}
9392
}
9493
}
95-
""".strip()
96-
)
94+
""".strip())
9795
response = self.client.post(self.url, payload, content_type="application/json")
9896

9997
# missing signature should cause failure

tcms_github_marketplace/urls.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
from django.urls import re_path
77
from tcms_github_marketplace import views
88

9-
109
urlpatterns = [
1110
re_path(
1211
r"^purchase_hook/$",

tcms_github_marketplace/views.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,6 @@
3939
from tcms_github_marketplace import utils
4040
from tcms_github_marketplace.models import Purchase
4141

42-
4342
UserModel = get_user_model()
4443

4544

0 commit comments

Comments
 (0)