mirror of
https://github.com/bookwyrm-social/bookwyrm.git
synced 2025-02-16 19:15:16 +00:00
Adds test to catch notification error
This commit is contained in:
parent
a7553c0b8c
commit
c092d952bd
2 changed files with 12 additions and 1 deletions
|
@ -76,6 +76,17 @@ class Notification(TestCase):
|
|||
notification.refresh_from_db()
|
||||
self.assertEqual(notification.related_users.count(), 2)
|
||||
|
||||
def test_notify_grouping_with_dupes(self):
|
||||
"""If there are multiple options to group with, don't cause an error"""
|
||||
models.Notification.objects.create(
|
||||
user=self.local_user, notification_type="FAVORITE"
|
||||
)
|
||||
models.Notification.objects.create(
|
||||
user=self.local_user, notification_type="FAVORITE"
|
||||
)
|
||||
models.Notification.notify(self.local_user, None, notification_type="FAVORITE")
|
||||
self.assertEqual(models.Notification.objects.count(), 2)
|
||||
|
||||
def test_notify_remote(self):
|
||||
"""Don't create notifications for remote users"""
|
||||
models.Notification.notify(
|
||||
|
|
|
@ -15,7 +15,7 @@ from .helpers import (
|
|||
handle_remote_webfinger,
|
||||
subscribe_remote_webfinger,
|
||||
WebFingerError,
|
||||
is_api_request
|
||||
is_api_request,
|
||||
)
|
||||
|
||||
|
||||
|
|
Loading…
Reference in a new issue