mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-09-11 10:28:41 -04:00
allow you to remove URL without removing bearer token
This commit is contained in:
+1
-3
@@ -829,9 +829,7 @@ class ServiceInboundNumberForm(StripWhitespaceForm):
|
|||||||
class CallbackForm(StripWhitespaceForm):
|
class CallbackForm(StripWhitespaceForm):
|
||||||
|
|
||||||
def validate(self):
|
def validate(self):
|
||||||
return super().validate() or (
|
return super().validate() or self.url.data == ''
|
||||||
self.url.data == '' and self.bearer_token.data == ''
|
|
||||||
)
|
|
||||||
|
|
||||||
|
|
||||||
class ServiceReceiveMessagesCallbackForm(CallbackForm):
|
class ServiceReceiveMessagesCallbackForm(CallbackForm):
|
||||||
|
|||||||
@@ -521,6 +521,7 @@ def test_callback_forms_validation(
|
|||||||
mock_get_empty_service_inbound_api,
|
mock_get_empty_service_inbound_api,
|
||||||
), [], False),
|
), [], False),
|
||||||
])
|
])
|
||||||
|
@pytest.mark.parametrize('bearer_token', ['', 'some-bearer-token'])
|
||||||
@pytest.mark.parametrize('endpoint, expected_delete_url', [
|
@pytest.mark.parametrize('endpoint, expected_delete_url', [
|
||||||
(
|
(
|
||||||
'main.delivery_status_callback',
|
'main.delivery_status_callback',
|
||||||
@@ -539,6 +540,7 @@ def test_callback_forms_can_be_cleared(
|
|||||||
delete_should_be_called,
|
delete_should_be_called,
|
||||||
endpoint,
|
endpoint,
|
||||||
expected_delete_url,
|
expected_delete_url,
|
||||||
|
bearer_token,
|
||||||
mocker,
|
mocker,
|
||||||
):
|
):
|
||||||
|
|
||||||
@@ -555,7 +557,7 @@ def test_callback_forms_can_be_cleared(
|
|||||||
service_id=service_one['id'],
|
service_id=service_one['id'],
|
||||||
_data={
|
_data={
|
||||||
'url': '',
|
'url': '',
|
||||||
'bearer_token': '',
|
'bearer_token': bearer_token,
|
||||||
},
|
},
|
||||||
_expected_redirect=url_for(
|
_expected_redirect=url_for(
|
||||||
'main.api_callbacks',
|
'main.api_callbacks',
|
||||||
|
|||||||
Reference in New Issue
Block a user