add test_api_publications_add

This commit is contained in:
Dmitry Belyaev 2021-09-22 15:49:58 +03:00
parent 9d9e213607
commit 72b13b7e98
Signed by: b4tman
GPG Key ID: 41A00BF15EA7E5F3

View File

@ -124,3 +124,21 @@ def test_api_infobases_available(client):
actual.sort()
assert actual == expected
def test_api_publications(client):
response = client.get('/api/v1/publications')
data = response.get_json()
assert data == []
def test_api_publications_add(client):
endpoint = '/api/v1/publications'
# before add
response = client.get(endpoint)
data = response.get_json()
assert data == []
# add
response = client.put(path=endpoint, data={'name': 'test123'})
data = response.get_json()
assert data['message'] == 'created'
assert data['name'] == 'test123'