From 71185e60f938d823fe627a6ef4f02af10b66490a Mon Sep 17 00:00:00 2001
From: Ernesto Rico Schmidt <ernesto@helsinki.at>
Date: Mon, 18 Mar 2024 11:27:00 -0400
Subject: [PATCH] fix: disable image tests with mark.skip

---
 program/tests/test_images.py | 145 +++++++++++++++++++----------------
 1 file changed, 80 insertions(+), 65 deletions(-)

diff --git a/program/tests/test_images.py b/program/tests/test_images.py
index b6ab2ede..250db793 100644
--- a/program/tests/test_images.py
+++ b/program/tests/test_images.py
@@ -18,127 +18,142 @@ def image_data() -> dict[str, str]:
     }
 
 
-# def test_create_image(image_file, common_api_client1):
-#     data = {"image": image_file}
+@pytest.mark.skip
+def test_create_image(image_file, common_api_client1):
+    data = {"image": image_file}
 
-#     response = common_api_client1.post(url(), data=data)
+    response = common_api_client1.post(url(), data=data)
 
-#     assert response.status_code == 201
+    assert response.status_code == 201
 
 
-# def test_delete_image(owned_image, common_api_client1):
-#     response = common_api_client1.delete(url(owned_image))
+@pytest.mark.skip
+def test_delete_image(owned_image, common_api_client1):
+    response = common_api_client1.delete(url(owned_image))
 
-#     assert response.status_code == 204
+    assert response.status_code == 204
 
 
-# def test_delete_image_not_found_for_different_user(owned_image, common_api_client2):
-#     response = common_api_client2.delete(url(owned_image))
+@pytest.mark.skip
+def test_delete_image_not_found_for_different_user(owned_image, common_api_client2):
+    response = common_api_client2.delete(url(owned_image))
 
-#     assert response.status_code == 404
+    assert response.status_code == 404
 
 
-# def test_list_images(image_file, common_user1, common_api_client1):
-#     IMAGES = 3
-#     ImageFactory.create_batch(size=IMAGES, image=image_file, owner=common_user1)
+@pytest.mark.skip
+def test_list_images(image_file, common_user1, common_api_client1):
+    IMAGES = 3
+    ImageFactory.create_batch(size=IMAGES, image=image_file, owner=common_user1)
 
-#     response = common_api_client1.get(url())
+    response = common_api_client1.get(url())
 
-#     assert response.status_code == 200
-#     assert len(response.data) == IMAGES
+    assert response.status_code == 200
+    assert len(response.data) == IMAGES
 
 
-# def test_list_images_for_different_user(image_file, common_user1, common_api_client2):
-#     IMAGES = 3
-#     ImageFactory.create_batch(size=IMAGES, image=image_file, owner=common_user1)
+@pytest.mark.skip
+def test_list_images_for_different_user(image_file, common_user1, common_api_client2):
+    IMAGES = 3
+    ImageFactory.create_batch(size=IMAGES, image=image_file, owner=common_user1)
 
-#     response = common_api_client2.get(url())
+    response = common_api_client2.get(url())
 
-#     assert response.status_code == 200
-#     assert len(response.data) == 0
+    assert response.status_code == 200
+    assert len(response.data) == 0
 
 
-# def test_retrieve_image(owned_image, common_api_client1):
-#     response = common_api_client1.get(url(owned_image))
+@pytest.mark.skip
+def test_retrieve_image(owned_image, common_api_client1):
+    response = common_api_client1.get(url(owned_image))
 
-#     assert response.status_code == 200
+    assert response.status_code == 200
 
 
-# def test_retrieve_image_not_found_for_different_user(owned_image, common_api_client2):
-#     response = common_api_client2.get(url(owned_image))
+@pytest.mark.skip
+def test_retrieve_image_not_found_for_different_user(owned_image, common_api_client2):
+    response = common_api_client2.get(url(owned_image))
 
-#     assert response.status_code == 404
+    assert response.status_code == 404
 
 
-# def test_update_alt_text(owned_image, common_api_client1):
-#     update = {"alt_text": "ALT_TEXT"}
+@pytest.mark.skip
+def test_update_alt_text(owned_image, common_api_client1):
+    update = {"alt_text": "ALT_TEXT"}
 
-#     response = common_api_client1.patch(url(owned_image), data=update)
+    response = common_api_client1.patch(url(owned_image), data=update)
 
-#     assert response.status_code == 200
+    assert response.status_code == 200
 
-#     assert_data(response, update)
+    assert_data(response, update)
 
 
-# def test_update_alt_text_not_found_for_different_user(owned_image, common_api_client2):
-#     update = {"alt_text": "ALT_TEXT", "credits": "CREDITS"}
+@pytest.mark.skip
+def test_update_alt_text_not_found_for_different_user(owned_image, common_api_client2):
+    update = {"alt_text": "ALT_TEXT", "credits": "CREDITS"}
 
-#     response = common_api_client2.patch(url(owned_image), data=update)
+    response = common_api_client2.patch(url(owned_image), data=update)
 
-#     assert response.status_code == 404
+    assert response.status_code == 404
 
 
-# def test_update_credits(owned_image, common_api_client1):
-#     update = {"credits": "CREDITS"}
+@pytest.mark.skip
+def test_update_credits(owned_image, common_api_client1):
+    update = {"credits": "CREDITS"}
 
-#     response = common_api_client1.patch(url(owned_image), data=update)
+    response = common_api_client1.patch(url(owned_image), data=update)
 
-#     assert response.status_code == 200
+    assert response.status_code == 200
 
-#     assert_data(response, update)
+    assert_data(response, update)
 
 
-# def test_update_credits_not_found_for_different_user(owned_image, common_api_client2):
-#     update = {"credits": "CREDITS"}
+@pytest.mark.skip
+def test_update_credits_not_found_for_different_user(owned_image, common_api_client2):
+    update = {"credits": "CREDITS"}
 
-#     response = common_api_client2.patch(url(owned_image), data=update)
+    response = common_api_client2.patch(url(owned_image), data=update)
 
-#     assert response.status_code == 404
+    assert response.status_code == 404
 
 
-# def test_update_ppoi(owned_image, common_api_client1):
-#     update = {"ppoi": "0.7x0.3"}
+@pytest.mark.skip
+def test_update_ppoi(owned_image, common_api_client1):
+    update = {"ppoi": "0.7x0.3"}
 
-#     response = common_api_client1.patch(url(owned_image), data=update)
+    response = common_api_client1.patch(url(owned_image), data=update)
 
-#     assert response.status_code == 200
+    assert response.status_code == 200
 
-#     assert_data(response, update)
+    assert_data(response, update)
 
 
-# def test_update_ppoi_not_found_for_different_user(owned_image, common_api_client2):
-#     update = {"ppoi": "0.7x0.3"}
+@pytest.mark.skip
+def test_update_ppoi_not_found_for_different_user(owned_image, common_api_client2):
+    update = {"ppoi": "0.7x0.3"}
 
-#     response = common_api_client2.patch(url(owned_image), data=update)
+    response = common_api_client2.patch(url(owned_image), data=update)
 
-#     assert response.status_code == 404
+    assert response.status_code == 404
 
 
-# def test_set_image_license(owned_image, common_api_client1, public_domain_license):
-#     update = {"license_id": public_domain_license.id}
+@pytest.mark.skip
+def test_set_image_license(owned_image, common_api_client1, public_domain_license):
+    update = {"license_id": public_domain_license.id}
 
-#     response = common_api_client1.patch(url(owned_image), data=update)
+    response = common_api_client1.patch(url(owned_image), data=update)
 
-#     assert response.status_code == 200
+    assert response.status_code == 200
 
-#     assert_data(response, update)
+    assert_data(response, update)
 
 
-# def test_unset_image_license(owned_licensed_image, common_api_client1):
-#     update = {"license_id": None}
+@pytest.mark.skip
+def test_unset_image_license(owned_licensed_image, common_api_client1):
+    update = {"license_id": None}
 
-#     response = common_api_client1.patch(url(owned_licensed_image), data=update, format="json")
+    response = common_api_client1.patch(url(owned_licensed_image), data=update, format="json")
 
-#     assert response.status_code == 200
+    assert response.status_code == 200
 
-#     assert_data(response, update)
+    assert_data(response, update)
-- 
GitLab