add test_api_publications_add_force

This commit is contained in:
Dmitry Belyaev 2021-09-24 15:23:30 +03:00
parent be03d196b7
commit ab6ab52f24
Signed by: b4tman
GPG Key ID: 41A00BF15EA7E5F3

View File

@ -148,6 +148,19 @@ def test_api_publications_add(client):
assert response.status_code == 409 assert response.status_code == 409
def test_api_publications_add_force(client):
endpoint = '/api/v1/publications'
# add
response = client.put(path=endpoint, data={'name': 'test123'})
assert response.status_code == 201
# add same publication
response = client.put(path=endpoint, data={'name': 'test123'})
assert response.status_code == 409
# add same publication with force
response = client.put(path=endpoint, data={'name': 'test123', 'force': True})
assert response.status_code == 201
def test_api_publications_add_and_list(client): def test_api_publications_add_and_list(client):
endpoint = '/api/v1/publications' endpoint = '/api/v1/publications'
# add publications # add publications