add test_api_publication_get

This commit is contained in:
Dmitry Belyaev 2021-09-22 16:17:19 +03:00
parent cb2de342c2
commit ee163fe9a1
Signed by: b4tman
GPG Key ID: 41A00BF15EA7E5F3

View File

@ -169,3 +169,17 @@ def test_api_publications_add_and_list(client):
assert data[1]['is_file_infobase'] assert data[1]['is_file_infobase']
assert data[1]['infobase_filepath'] == '/path/to/infobase' assert data[1]['infobase_filepath'] == '/path/to/infobase'
def test_api_publication_get(client):
# add publications
client.put(path='/api/v1/publications', data={'name': 'test123'})
# get
response = client.get('/api/v1/publications/test123')
data = response.get_json()
assert 'test123' in data
data = data['test123']
assert data['name'] == 'test123'
assert data['publicated']
assert data['url'] == '/1c/test123'
assert not data['is_file_infobase']