11import pytest
2+ from rest_framework .test import APIClient
23
34from environments .models import Environment
45from integrations .sentry .models import SentryChangeTrackingConfiguration
56
6- from rest_framework .test import APIClient
7-
87
98def 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)
8786def test_sentry__change_tracking__setup__rejects_invalid_configuration (
0 commit comments