Skip to content

Commit

Permalink
More coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
norkans7 committed Feb 2, 2023
1 parent 253d7c2 commit 6ad473c
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
6 changes: 6 additions & 0 deletions temba/channels/types/twilio/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -298,6 +298,12 @@ def test_update(self):
self.assertEqual(twilio_channel.config[Channel.CONFIG_AUTH_TOKEN], "AccountToken")
self.assertTrue(twilio_channel.check_credentials())

with patch("temba.channels.types.twilio.type.TwilioType.check_credentials") as mock_check_credentials:
mock_check_credentials.return_value = False

response = self.client.post(update_url, post_data)
self.assertFormError(response, "form", "__all__", "Channel credentials don't appear to be valid.")

@patch("temba.orgs.models.TwilioClient", MockTwilioClient)
@patch("twilio.request_validator.RequestValidator", MockRequestValidator)
def test_deactivate(self):
Expand Down
2 changes: 1 addition & 1 deletion temba/channels/types/twilio/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -364,7 +364,7 @@ def clean(self) -> Dict[str, Any]:
_("The Twilio account SID and Token seem invalid. Please check them again and retry.")
)

return self.cleaned_data
return super().clean()

class Meta(UpdateChannelForm.Meta):
fields = ("name",)

0 comments on commit 6ad473c

Please sign in to comment.