From 0240f792951444d6459e7621f43f0fc892599402 Mon Sep 17 00:00:00 2001 From: Bryan Newbold Date: Thu, 4 Apr 2019 18:17:55 -0700 Subject: test already-merged editgroup_id (via web form) --- python/tests/web_entity_views.py | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/python/tests/web_entity_views.py b/python/tests/web_entity_views.py index 263a4652..1f22a803 100644 --- a/python/tests/web_entity_views.py +++ b/python/tests/web_entity_views.py @@ -240,7 +240,7 @@ def test_web_release_login(full_app, app_admin): # creation (via form) with full_app.test_request_context(): - form= ReleaseEntityForm() + form = ReleaseEntityForm() form.title.data = "My Research: Missing Some Stuff" rv = app_admin.post('/release/create', data=form.data, follow_redirects=True) assert rv.status_code == 400 @@ -255,9 +255,21 @@ def test_web_release_login(full_app, app_admin): rv = app_admin.post('/release/create', data=form.data, follow_redirects=True) assert rv.status_code == 200 + with full_app.test_request_context(): + form = ReleaseEntityForm() + # these fields are required + form.title.data = "Creating Releases: A Review" + form.release_type.data = "article-journal" + form.release_status.data = "draft" + # already merged editgroup + form.editgroup_id.data = "aaaaaaaaaaaabo53aaaaaaaaae" + rv = app_admin.post('/release/create', data=form.data, follow_redirects=True) + assert rv.status_code == 400 + assert b"already merged" in rv.data + # editing with full_app.test_request_context(): - form= ReleaseEntityForm() + form = ReleaseEntityForm() form.title.data = "My Research: Missing Some Stuff" form.release_type.data = "bogus-release-type" rv = app_admin.post('/release/create', data=form.data, follow_redirects=True) -- cgit v1.2.3