Add WebhookTestCase abstract class for writing webhook tests.

This cuts a ton of code duplication and semi-duplication between the
webhook tests, and thus should make it a lot easier to write new ones.
This commit is contained in:
Tomasz Kolek
2016-05-16 23:37:53 +02:00
committed by Tim Abbott
parent 016a2faa23
commit c4254497b2
4 changed files with 590 additions and 731 deletions

View File

@@ -0,0 +1,7 @@
{
"messages": [
{
"type": "incident.triggered"
}
]
}

View File

@@ -0,0 +1,7 @@
{
"messages": [
{
"type": "foo"
}
]
}

View File

@@ -359,7 +359,7 @@ class AuthedTestCase(TestCase):
self.assert_json_success(result)
# Check the correct message was sent
msg = Message.objects.filter().order_by('-id')[0]
msg = self.get_last_message()
self.assertEqual(msg.sender.email, email)
self.assertEqual(get_display_recipient(msg.recipient), stream_name)

File diff suppressed because it is too large Load Diff