Skip to content

Commit

Permalink
refactor(tests_signals.py): test plus concis
Browse files Browse the repository at this point in the history
  • Loading branch information
calummackervoy committed Jul 2, 2024
1 parent 59d335e commit 0a40106
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions lacommunaute/notification/tests/tests_signals.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from django.test import TestCase

from lacommunaute.forum_conversation.factories import (
AnonymousPostFactory,
AnonymousTopicFactory,
PostFactory,
TopicFactory,
)
Expand Down Expand Up @@ -45,14 +45,13 @@ def test_notifications_on_post_creation_upvote_follower(self):
assert notification.delay == NotificationDelay.ASAP

def test_notifications_on_post_creation_anonymous_poster(self):
topic = TopicFactory(with_post=True)
anonymous_post = AnonymousPostFactory(topic=topic)
topic = AnonymousTopicFactory(with_post=True)

post = PostFactory(topic=topic)
notification = Notification.objects.get(recipient=anonymous_post.username)
notification = Notification.objects.get(recipient=topic.first_post.username)
assert notification.post == post
assert notification.kind == EmailSentTrackKind.FOLLOWING_REPLIES
assert notification.delay == NotificationDelay.DAY
assert notification.kind == EmailSentTrackKind.FIRST_REPLY
assert notification.delay == NotificationDelay.ASAP

def test_notifications_no_approved_post(self):
topic = TopicFactory(with_post=True)
Expand Down

0 comments on commit 0a40106

Please sign in to comment.