Fix line notify test to avoid duplicate post calls
@@ -33,13 +33,15 @@ class LineNotifyTest(TestCase):
@override_settings(PROMGEN=TEST_SETTINGS)
@mock.patch('requests.post')
- def test_project(self, mock_post):
+ def test_line_notify(self, mock_post):
self.client.post(reverse('alert'),
data=json.dumps(TEST_ALERT),
content_type='application/json'
)
- mock_post.assert_called_once_with(
+ mock_post.assert_has_calls([
+ mock.call(
'https://notify.example',
data={'message': _MESSAGE},
headers={'Authorization': 'Bearer hogehoge'},
)
+ ], any_order=True)
