Skip to content

Commit

Permalink
feat: testcase_notification_infra
Browse files Browse the repository at this point in the history
  • Loading branch information
권효진 authored and 권효진 committed Aug 25, 2024
1 parent 32cba7f commit 41da2ef
Show file tree
Hide file tree
Showing 5 changed files with 358 additions and 0 deletions.
6 changes: 6 additions & 0 deletions ara/infra/notification/notification_infra.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,10 +63,13 @@ def _get_display_name(self, article: Article, profile: int):
return "익명"

def create_notification(self, comment: Comment) -> None:
print("______________dddd________")

def notify_article_commented(_parent_article: Article, _comment: Comment):
name = self._get_display_name(_parent_article, _comment.created_by_id)
title = f"{name} 님이 새로운 댓글을 작성했습니다."

print(f"Creating notification for article commented: {title}")
notification = Notification(
type="article_commented",
title=title,
Expand All @@ -81,6 +84,8 @@ def notify_article_commented(_parent_article: Article, _comment: Comment):
notification=notification,
)

print("하이\n")

fcm_notify_comment(
_parent_article.created_by,
title,
Expand All @@ -92,6 +97,7 @@ def notify_comment_commented(_parent_article: Article, _comment: Comment):
name = self._get_display_name(_parent_article, _comment.created_by_id)
title = f"{name} 님이 새로운 대댓글을 작성했습니다."

print(f"Creating notification for comment commented: {title}")
notification = Notification(
type="comment_commented",
title=title,
Expand Down
Loading

0 comments on commit 41da2ef

Please sign in to comment.