1
0
Fork 0

Gracefully handle unknown status types

Fixes #432
This commit is contained in:
Mouse Reeve 2020-12-30 12:01:15 -08:00
parent 673d70aca9
commit e0adb3307b
2 changed files with 12 additions and 2 deletions

View file

@ -272,6 +272,12 @@ class Incoming(TestCase):
incoming.handle_create(activity)
self.assertEqual(models.Status.objects.count(), 2)
def test_handle_create_unknown_type(self):
''' folks send you all kinds of things '''
activity = {'object': {'id': 'hi'}, 'type': 'Fish'}
result = incoming.handle_create(activity)
self.assertIsNone(result)
def test_handle_create_remote_note_with_mention(self):
''' should only create it under the right circumstances '''
self.assertEqual(models.Status.objects.count(), 1)