Skip to content

Commit

Permalink
Test that integrity errors prevent completing copyedit.
Browse files Browse the repository at this point in the history
If a submitted project contains integrity errors (such as a required
field being blank), then the editor should be required to fix those
errors during the "awaiting copyedit" stage, before the project can be
advanced to "awaiting author approval".
  • Loading branch information
Benjamin Moody committed Aug 14, 2024
1 parent f457655 commit 852332b
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions physionet-django/console/test_views.py
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,27 @@ def test_copyedit(self):
data={'reopen_copyedit':''})
project = ActiveProject.objects.get(id=project.id)
self.assertTrue(project.copyeditable())

# Erase a required field
project.refresh_from_db()
project.abstract = ''
project.save()

# "Complete copyedit" should fail because abstract is missing
response = self.client.post(
reverse('copyedit_submission', args=(project.slug,)), data={
'complete_copyedit': '',
'made_changes': 1,
'changelog_summary': 'Removed abstract',
})
project.refresh_from_db()
self.assertTrue(project.copyeditable())

# Restore abstract
project.refresh_from_db()
project.abstract = '<p>Database of annotated ECGs</p>'
project.save()

# Recomplete copyedit
response = self.client.post(reverse(
'copyedit_submission', args=(project.slug,)),
Expand Down

0 comments on commit 852332b

Please sign in to comment.