aboutsummaryrefslogtreecommitdiffstats
path: root/python/tests
diff options
context:
space:
mode:
authorBryan Newbold <bnewbold@robocracy.org>2019-02-14 16:24:16 -0800
committerBryan Newbold <bnewbold@robocracy.org>2019-02-14 16:24:16 -0800
commitb9699e27936573271506dbf6a3af744f7b454c03 (patch)
treea5ec41bf27f844fad32ca7f6aa1c254bd5c424ae /python/tests
parent70b4bc18b13f59c9d42c8e44ef872dfd2e1abef3 (diff)
downloadfatcat-b9699e27936573271506dbf6a3af744f7b454c03.tar.gz
fatcat-b9699e27936573271506dbf6a3af744f7b454c03.zip
verify release_status field
Diffstat (limited to 'python/tests')
-rw-r--r--python/tests/api_releases.py19
1 files changed, 18 insertions, 1 deletions
diff --git a/python/tests/api_releases.py b/python/tests/api_releases.py
index 247ad2c2..9a64e0f9 100644
--- a/python/tests/api_releases.py
+++ b/python/tests/api_releases.py
@@ -18,7 +18,7 @@ def test_release(api):
title="some title",
original_title="оригинальное название",
release_type="post-weblog",
- release_status="pre-print",
+ release_status="submitted",
release_date=datetime.datetime.utcnow().date(),
release_year=2015,
doi="10.5555/12345678",
@@ -114,3 +114,20 @@ def test_empty_fields(api):
with pytest.raises(fatcat_client.rest.ApiException):
r2 = ReleaseEntity(title="something", contribs=[ReleaseContrib(raw_name="")])
api.create_release(r2, editgroup_id=eg.editgroup_id)
+
+def test_controlled_vocab(api):
+
+ eg = quick_eg(api)
+
+ r1 = ReleaseEntity(title="something", release_type="journal-thingie")
+ with pytest.raises(fatcat_client.rest.ApiException):
+ api.create_release(r1, editgroup_id=eg.editgroup_id)
+ r1.release_type = "article"
+ api.create_release(r1, editgroup_id=eg.editgroup_id)
+
+ r2 = ReleaseEntity(title="something elase", release_status="pre-print")
+ with pytest.raises(fatcat_client.rest.ApiException):
+ api.create_release(r2, editgroup_id=eg.editgroup_id)
+ r2.release_status = "published"
+ api.create_release(r2, editgroup_id=eg.editgroup_id)
+