Skip to content
Snippets Groups Projects
Verified Commit 26e36d59 authored by Ernesto Rico Schmidt's avatar Ernesto Rico Schmidt
Browse files

test: fix & enable tests for images

parent 2c519fd4
No related branches found
No related tags found
No related merge requests found
...@@ -18,7 +18,6 @@ def image_data() -> dict[str, str]: ...@@ -18,7 +18,6 @@ def image_data() -> dict[str, str]:
} }
@pytest.mark.skip
def test_create_image(image_file, common_api_client1): def test_create_image(image_file, common_api_client1):
data = {"image": image_file} data = {"image": image_file}
...@@ -27,21 +26,18 @@ def test_create_image(image_file, common_api_client1): ...@@ -27,21 +26,18 @@ def test_create_image(image_file, common_api_client1):
assert response.status_code == 201 assert response.status_code == 201
@pytest.mark.skip
def test_delete_image(owned_image, common_api_client1): def test_delete_image(owned_image, common_api_client1):
response = common_api_client1.delete(url(owned_image)) response = common_api_client1.delete(url(owned_image))
assert response.status_code == 204 assert response.status_code == 204
@pytest.mark.skip
def test_delete_image_not_found_for_different_user(owned_image, common_api_client2): def test_delete_image_not_found_for_different_user(owned_image, common_api_client2):
response = common_api_client2.delete(url(owned_image)) response = common_api_client2.delete(url(owned_image))
assert response.status_code == 404 assert response.status_code == 404
@pytest.mark.skip
def test_list_images(image_file, common_user1, common_api_client1): def test_list_images(image_file, common_user1, common_api_client1):
IMAGES = 3 IMAGES = 3
ImageFactory.create_batch(size=IMAGES, image=image_file, owner=common_user1) ImageFactory.create_batch(size=IMAGES, image=image_file, owner=common_user1)
...@@ -52,7 +48,6 @@ def test_list_images(image_file, common_user1, common_api_client1): ...@@ -52,7 +48,6 @@ def test_list_images(image_file, common_user1, common_api_client1):
assert len(response.data) == IMAGES assert len(response.data) == IMAGES
@pytest.mark.skip
def test_list_images_for_different_user(image_file, common_user1, common_api_client2): def test_list_images_for_different_user(image_file, common_user1, common_api_client2):
IMAGES = 3 IMAGES = 3
ImageFactory.create_batch(size=IMAGES, image=image_file, owner=common_user1) ImageFactory.create_batch(size=IMAGES, image=image_file, owner=common_user1)
...@@ -60,24 +55,21 @@ def test_list_images_for_different_user(image_file, common_user1, common_api_cli ...@@ -60,24 +55,21 @@ def test_list_images_for_different_user(image_file, common_user1, common_api_cli
response = common_api_client2.get(url()) response = common_api_client2.get(url())
assert response.status_code == 200 assert response.status_code == 200
assert len(response.data) == 0 assert len(response.data) == IMAGES
@pytest.mark.skip
def test_retrieve_image(owned_image, common_api_client1): def test_retrieve_image(owned_image, common_api_client1):
response = common_api_client1.get(url(owned_image)) response = common_api_client1.get(url(owned_image))
assert response.status_code == 200 assert response.status_code == 200
@pytest.mark.skip def test_retrieve_image_for_different_user(owned_image, common_api_client2):
def test_retrieve_image_not_found_for_different_user(owned_image, common_api_client2):
response = common_api_client2.get(url(owned_image)) response = common_api_client2.get(url(owned_image))
assert response.status_code == 404 assert response.status_code == 200
@pytest.mark.skip
def test_update_alt_text(owned_image, common_api_client1): def test_update_alt_text(owned_image, common_api_client1):
update = {"alt_text": "ALT_TEXT"} update = {"alt_text": "ALT_TEXT"}
...@@ -88,7 +80,6 @@ def test_update_alt_text(owned_image, common_api_client1): ...@@ -88,7 +80,6 @@ def test_update_alt_text(owned_image, common_api_client1):
assert_data(response, update) assert_data(response, update)
@pytest.mark.skip
def test_update_alt_text_not_found_for_different_user(owned_image, common_api_client2): def test_update_alt_text_not_found_for_different_user(owned_image, common_api_client2):
update = {"alt_text": "ALT_TEXT", "credits": "CREDITS"} update = {"alt_text": "ALT_TEXT", "credits": "CREDITS"}
...@@ -97,7 +88,6 @@ def test_update_alt_text_not_found_for_different_user(owned_image, common_api_cl ...@@ -97,7 +88,6 @@ def test_update_alt_text_not_found_for_different_user(owned_image, common_api_cl
assert response.status_code == 404 assert response.status_code == 404
@pytest.mark.skip
def test_update_credits(owned_image, common_api_client1): def test_update_credits(owned_image, common_api_client1):
update = {"credits": "CREDITS"} update = {"credits": "CREDITS"}
...@@ -108,7 +98,6 @@ def test_update_credits(owned_image, common_api_client1): ...@@ -108,7 +98,6 @@ def test_update_credits(owned_image, common_api_client1):
assert_data(response, update) assert_data(response, update)
@pytest.mark.skip
def test_update_credits_not_found_for_different_user(owned_image, common_api_client2): def test_update_credits_not_found_for_different_user(owned_image, common_api_client2):
update = {"credits": "CREDITS"} update = {"credits": "CREDITS"}
...@@ -117,7 +106,6 @@ def test_update_credits_not_found_for_different_user(owned_image, common_api_cli ...@@ -117,7 +106,6 @@ def test_update_credits_not_found_for_different_user(owned_image, common_api_cli
assert response.status_code == 404 assert response.status_code == 404
@pytest.mark.skip
def test_update_ppoi(owned_image, common_api_client1): def test_update_ppoi(owned_image, common_api_client1):
update = {"ppoi": "0.7x0.3"} update = {"ppoi": "0.7x0.3"}
...@@ -128,7 +116,6 @@ def test_update_ppoi(owned_image, common_api_client1): ...@@ -128,7 +116,6 @@ def test_update_ppoi(owned_image, common_api_client1):
assert_data(response, update) assert_data(response, update)
@pytest.mark.skip
def test_update_ppoi_not_found_for_different_user(owned_image, common_api_client2): def test_update_ppoi_not_found_for_different_user(owned_image, common_api_client2):
update = {"ppoi": "0.7x0.3"} update = {"ppoi": "0.7x0.3"}
...@@ -137,7 +124,6 @@ def test_update_ppoi_not_found_for_different_user(owned_image, common_api_client ...@@ -137,7 +124,6 @@ def test_update_ppoi_not_found_for_different_user(owned_image, common_api_client
assert response.status_code == 404 assert response.status_code == 404
@pytest.mark.skip
def test_set_image_license(owned_image, common_api_client1, public_domain_license): def test_set_image_license(owned_image, common_api_client1, public_domain_license):
update = {"license_id": public_domain_license.id} update = {"license_id": public_domain_license.id}
...@@ -148,7 +134,6 @@ def test_set_image_license(owned_image, common_api_client1, public_domain_licens ...@@ -148,7 +134,6 @@ def test_set_image_license(owned_image, common_api_client1, public_domain_licens
assert_data(response, update) assert_data(response, update)
@pytest.mark.skip
def test_unset_image_license(owned_licensed_image, common_api_client1): def test_unset_image_license(owned_licensed_image, common_api_client1):
update = {"license_id": None} update = {"license_id": None}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment