Skip to content

Commit a298322

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

2 files changed

Lines changed: 24 additions & 23 deletions

File tree

api/integrations/sentry/serializers.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,9 @@
33
from .models import SentryChangeTrackingConfiguration
44

55

6-
class SentryChangeTrackingConfigurationSerializer(BaseEnvironmentIntegrationModelSerializer):
6+
class SentryChangeTrackingConfigurationSerializer(
7+
BaseEnvironmentIntegrationModelSerializer
8+
):
79
class Meta:
810
model = SentryChangeTrackingConfiguration
911
fields = ["pk", "environment", "webhook_url", "secret"]

api/tests/unit/integrations/sentry/test_unit_sentry_change_tracking.py

Lines changed: 21 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
11
import pytest
2+
from rest_framework.test import APIClient
23

34
from environments.models import Environment
45
from integrations.sentry.models import SentryChangeTrackingConfiguration
56

6-
from rest_framework.test import APIClient
7-
87

98
def test_sentry__change_tracking__setup__accepts_new_configuration(
109
admin_client: APIClient,
@@ -23,11 +22,15 @@ def test_sentry__change_tracking__setup__accepts_new_configuration(
2322

2423
# Then
2524
assert response.status_code == 201
26-
assert SentryChangeTrackingConfiguration.objects.filter(
27-
environment=environment,
28-
webhook_url="https://sentry.example.com/webhook",
29-
secret="hush hush!",
30-
).count() == 1
25+
assert (
26+
SentryChangeTrackingConfiguration.objects.filter(
27+
environment=environment,
28+
webhook_url="https://sentry.example.com/webhook",
29+
secret="hush hush!",
30+
).count()
31+
== 1
32+
)
33+
3134

3235
@pytest.mark.parametrize(
3336
"payload, errors",
@@ -38,15 +41,15 @@ def test_sentry__change_tracking__setup__accepts_new_configuration(
3841
},
3942
{
4043
"webhook_url": ["This field is required."],
41-
}
44+
},
4245
),
4346
(
4447
{
4548
"webhook_url": "https://sentry.example.com/webhook",
4649
},
4750
{
4851
"secret": ["This field is required."],
49-
}
52+
},
5053
),
5154
(
5255
{
@@ -55,33 +58,29 @@ def test_sentry__change_tracking__setup__accepts_new_configuration(
5558
},
5659
{
5760
"secret": ["Ensure this field has at least 10 characters."],
58-
}
61+
},
5962
),
6063
(
61-
{
62-
"webhook_url": "https://sentry.example.com/webhook",
63-
"secret": "Hush, hush, hush, hush; I've already spoken, our love is broken; Baby, hush, hush",
64-
},
65-
{
66-
"secret": ["Ensure this field has no more than 60 characters."]
67-
}
64+
{
65+
"webhook_url": "https://sentry.example.com/webhook",
66+
"secret": "Hush, hush, hush, hush; I've already spoken, our love is broken; Baby, hush, hush",
67+
},
68+
{"secret": ["Ensure this field has no more than 60 characters."]},
6869
),
6970
(
7071
{
7172
"webhook_url": "https://sentry.example.com/webhook",
7273
"secret": "Hush, hush, hush, hush; I've already spoken, our love is broken; Baby, hush, hush",
7374
},
74-
{
75-
"secret": ["Ensure this field has no more than 60 characters."]
76-
}
75+
{"secret": ["Ensure this field has no more than 60 characters."]},
7776
),
7877
(
7978
{
8079
"webhook_url": "https://sentry.example.com/webhook",
8180
"secret": "hush hush!",
8281
},
83-
['This integration already exists for this environment.']
84-
)
82+
["This integration already exists for this environment."],
83+
),
8584
],
8685
)
8786
def test_sentry__change_tracking__setup__rejects_invalid_configuration(

0 commit comments

Comments
 (0)