Skip to content

Commit

Permalink
fix: create PeerReviewer object in test mock data
Browse files Browse the repository at this point in the history
  • Loading branch information
Karthik99999 committed Sep 30, 2024
1 parent fc85cf9 commit 2aa9678
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
2 changes: 1 addition & 1 deletion django/library/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -2334,7 +2334,7 @@ def decline(self):
send_markdown_email(
subject="Peer review: declined invitation to review model",
template_name="library/review/email/review_invitation_declined.jinja",
context={"invitation": self},
context={"invitation": self, "profile": self.reviewer.member_profile},
to=[settings.REVIEW_EDITOR_EMAIL],
)

Expand Down
7 changes: 5 additions & 2 deletions django/library/tests/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
Contributor,
PeerReviewInvitation,
PeerReview,
PeerReviewer,
)
from library.serializers import CodebaseSerializer

Expand Down Expand Up @@ -136,7 +137,8 @@ def __init__(self, editor, reviewer, review):

def get_default_data(self):
return {
"candidate_reviewer": self.reviewer,
"candidate_reviewer": self.reviewer.member_profile,
"reviewer": self.reviewer,
"editor": self.editor,
"review": self.review,
}
Expand All @@ -155,7 +157,8 @@ class ReviewSetup:
def setUpReviewData(cls):
cls.user_factory = UserFactory()
cls.editor = cls.user_factory.create().member_profile
cls.reviewer = cls.user_factory.create().member_profile
reviewer = cls.user_factory.create().member_profile
cls.reviewer = PeerReviewer.objects.create(member_profile=reviewer)
cls.submitter = cls.user_factory.create()

cls.codebase_factory = CodebaseFactory(cls.submitter)
Expand Down

0 comments on commit 2aa9678

Please sign in to comment.