Skip to content

Commit

Permalink
shorten lines
Browse files Browse the repository at this point in the history
  • Loading branch information
everreau authored and ajrbyers committed Jul 23, 2024
1 parent bb04452 commit ed58904
Showing 1 changed file with 30 additions and 17 deletions.
47 changes: 30 additions & 17 deletions src/review/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -276,35 +276,48 @@ def test_csv_doesnt_create_duplicate_assignments(self):
)

def test_incomplete_reviews(self):
article1 = helpers.create_article(self.journal_one,
**{'owner': self.regular_user,
'title': 'Test Article',
'stage': submission_models.STAGE_UNDER_REVIEW,})
args = {'owner': self.regular_user,
'title': 'Test Article',
'stage': submission_models.STAGE_UNDER_REVIEW,}
article1 = helpers.create_article(self.journal_one, **args)

article1.correspondence_author = self.regular_user
article1.save()

round = review_models.ReviewRound.objects.create(article=article1, round_number=1,)
round = review_models.ReviewRound.objects.create(article=article1,
round_number=1,)

assignment = helpers.create_review_assignment(journal=self.journal_one,
article=article1,
is_complete=False,
review_round=round,
reviewer=self.regular_user,)
assignment = helpers.create_review_assignment(
journal=self.journal_one,
article=article1,
is_complete=False,
review_round=round,
reviewer=self.regular_user,
)
assignment.decision = None
assignment.save()

self.client.force_login(self.editor)
decline_url = reverse('review_decision',
kwargs={'article_id': article1.pk,
'decision': 'decline'})
response = self.client.get(decline_url, SERVER_NAME=self.journal_one.domain,)
self.assertContains(response, "The following incomplete reviews will be marked as withdrawn")

data = {'cc': [''], 'bcc': [''], 'subject': ['Article Declined'], 'body': ['Article Declined'], 'attachments': [''], 'skip': ['skip']}
response = self.client.post(decline_url, data, SERVER_NAME=self.journal_one.domain,)
self.assertEqual(article1.reviewassignment_set.filter(is_complete=True).count(), 1)
self.assertEqual(article1.reviewassignment_set.filter(is_complete=False).count(), 0)
response = self.client.get(decline_url,
SERVER_NAME=self.journal_one.domain,)
msg = "The following incomplete reviews will be marked as withdrawn"
self.assertContains(response, msg)

data = {'cc': [''],
'bcc': [''],
'subject': ['Article Declined'],
'body': ['Article Declined'],
'attachments': [''],
'skip': ['skip']}
response = self.client.post(decline_url,
data,
SERVER_NAME=self.journal_one.domain,)
review_set = article1.reviewassignment_set.all()
self.assertEqual(review_set.filter(is_complete=True).count(), 1)
self.assertEqual(review_set.filter(is_complete=False).count(), 0)

def test_completed_reviews_shared_setting(self):
# setup data
Expand Down

0 comments on commit ed58904

Please sign in to comment.