add test_api_publication_set_url
This commit is contained in:
parent
7d91b69e81
commit
f311a5788e
@ -197,3 +197,19 @@ def test_api_publication_remove(client):
|
|||||||
response = client.get('/api/v1/publications/test123')
|
response = client.get('/api/v1/publications/test123')
|
||||||
assert response.status_code == 404
|
assert response.status_code == 404
|
||||||
|
|
||||||
|
|
||||||
|
def test_api_publication_set_url(client):
|
||||||
|
# add publications
|
||||||
|
client.put(path='/api/v1/publications', data={'name': 'test123', 'url': 'some/url'})
|
||||||
|
# get
|
||||||
|
response = client.get('/api/v1/publications/test123/url')
|
||||||
|
data = response.get_json()
|
||||||
|
assert data['url'] == '/1c/some/url'
|
||||||
|
# set url
|
||||||
|
response = client.post(path='/api/v1/publications/test123/url', data={'url': '/another/url'})
|
||||||
|
assert response.status_code == 200
|
||||||
|
# get
|
||||||
|
response = client.get('/api/v1/publications/test123/url')
|
||||||
|
data = response.get_json()
|
||||||
|
assert data['url'] == '/1c/another/url'
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user