aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRomain Porte <microjoe@microjoe.org>2017-11-11 19:23:31 +0100
committerBoris Bobrov <breton@cynicmansion.ru>2017-11-12 00:08:02 +0300
commit65945005cf13fe78235df14d1e8c604b8cb6352c (patch)
tree4d7f96d6ddc67fe246ec71e2dea15c323e2a62f4
parent6810ba03d4c00de862573ff12b4203be809ac371 (diff)
downloadmediagoblin-65945005cf13fe78235df14d1e8c604b8cb6352c.tar.lz
mediagoblin-65945005cf13fe78235df14d1e8c604b8cb6352c.tar.xz
mediagoblin-65945005cf13fe78235df14d1e8c604b8cb6352c.zip
Added tests for tags in image API object
-rw-r--r--mediagoblin/tests/test_api.py14
1 files changed, 14 insertions, 0 deletions
diff --git a/mediagoblin/tests/test_api.py b/mediagoblin/tests/test_api.py
index 68b962a2..f4741fd1 100644
--- a/mediagoblin/tests/test_api.py
+++ b/mediagoblin/tests/test_api.py
@@ -158,6 +158,19 @@ class TestAPI(object):
assert data["object"]["fullImage"]["url"].endswith("hello.jpg")
assert data["object"]["image"]["url"].endswith("hello.thumbnail.jpg")
+ def test_can_post_image_tags(self, test_app):
+ """ Tests that an image can be posted to the API """
+ # First request we need to do is to upload the image
+ response, image = self._upload_image(test_app, GOOD_JPG)
+ assert response.status_code == 200
+
+ image["tags"] = ["hello", "world"]
+
+ # Check that we got the response we're expecting
+ response, data = self._post_image_to_feed(test_app, image)
+ assert response.status_code == 200
+ assert data["object"]["tags"] == ["hello", "world"]
+
def test_unable_to_upload_as_someone_else(self, test_app):
""" Test that can't upload as someoen else """
data = open(GOOD_JPG, "rb").read()
@@ -327,6 +340,7 @@ class TestAPI(object):
assert "fullImage" in image
assert "pump_io" in image
assert "links" in image
+ assert "tags" in image
def test_post_comment(self, test_app):
""" Tests that I can post an comment media """