mirror of
https://github.com/bookwyrm-social/bookwyrm.git
synced 2024-11-26 19:41:11 +00:00
Updates notification view tests
This commit is contained in:
parent
37bcb031f7
commit
24349b0a4c
2 changed files with 18 additions and 12 deletions
|
@ -60,7 +60,7 @@ class InteractionViews(TestCase):
|
|||
notification = models.Notification.objects.get()
|
||||
self.assertEqual(notification.notification_type, "FAVORITE")
|
||||
self.assertEqual(notification.user, self.local_user)
|
||||
self.assertEqual(notification.related_user, self.remote_user)
|
||||
self.assertEqual(notification.related_users.first(), self.remote_user)
|
||||
|
||||
def test_unfavorite(self, *_):
|
||||
"""unfav a status"""
|
||||
|
@ -98,7 +98,7 @@ class InteractionViews(TestCase):
|
|||
notification = models.Notification.objects.get()
|
||||
self.assertEqual(notification.notification_type, "BOOST")
|
||||
self.assertEqual(notification.user, self.local_user)
|
||||
self.assertEqual(notification.related_user, self.remote_user)
|
||||
self.assertEqual(notification.related_users.first(), self.remote_user)
|
||||
self.assertEqual(notification.related_status, status)
|
||||
|
||||
def test_self_boost(self, *_):
|
||||
|
|
|
@ -25,10 +25,12 @@ class NotificationViews(TestCase):
|
|||
local=True,
|
||||
localname="mouse",
|
||||
)
|
||||
self.another_user = models.User.objects.create_user(
|
||||
"rat", "rat@rat.rat", "ratword", local=True, localname="rat"
|
||||
)
|
||||
with patch("bookwyrm.models.activitypub_mixin.broadcast_task.apply_async"):
|
||||
self.status = models.Status.objects.create(
|
||||
content="hi",
|
||||
user=self.local_user,
|
||||
content="hi", user=self.local_user
|
||||
)
|
||||
models.SiteSettings.objects.create()
|
||||
|
||||
|
@ -44,25 +46,29 @@ class NotificationViews(TestCase):
|
|||
|
||||
def test_notifications_page_notifications(self):
|
||||
"""there are so many views, this just makes sure it LOADS"""
|
||||
models.Notification.objects.create(
|
||||
user=self.local_user,
|
||||
models.Notification.notify(
|
||||
self.local_user,
|
||||
self.another_user,
|
||||
notification_type="FAVORITE",
|
||||
related_status=self.status,
|
||||
)
|
||||
models.Notification.objects.create(
|
||||
user=self.local_user,
|
||||
models.Notification.notify(
|
||||
self.local_user,
|
||||
self.another_user,
|
||||
notification_type="BOOST",
|
||||
related_status=self.status,
|
||||
)
|
||||
models.Notification.objects.create(
|
||||
user=self.local_user,
|
||||
models.Notification.notify(
|
||||
self.local_user,
|
||||
self.another_user,
|
||||
notification_type="MENTION",
|
||||
related_status=self.status,
|
||||
)
|
||||
self.status.reply_parent = self.status
|
||||
self.status.save(broadcast=False)
|
||||
models.Notification.objects.create(
|
||||
user=self.local_user,
|
||||
models.Notification.notify(
|
||||
self.local_user,
|
||||
self.another_user,
|
||||
notification_type="REPLY",
|
||||
related_status=self.status,
|
||||
)
|
||||
|
|
Loading…
Reference in a new issue