eschutho commented on code in PR #24964:
URL: https://github.com/apache/superset/pull/24964#discussion_r1321913910


##########
tests/integration_tests/tags/api_tests.py:
##########
@@ -501,3 +503,54 @@ def test_put_tag(self):
             .one_or_none()
         )
         assert tag is not None
+
+    @pytest.mark.usefixtures("load_world_bank_dashboard_with_slices")
+    @pytest.mark.usefixtures("create_tags")
+    def test_failed_put_tag(self):
+        self.login(username="admin")
+
+        tag_to_update = db.session.query(Tag).first()
+        uri = f"api/v1/tag/{tag_to_update.id}"
+        rv = self.client.put(uri, json={"foo": "bar"})
+
+        self.assertEqual(rv.status_code, 400)
+
+    @pytest.mark.usefixtures("load_world_bank_dashboard_with_slices")
+    def test_post_bulk_tag(self):
+        self.login(username="admin")
+        uri = "api/v1/tag/bulk_create"
+        dashboard = (
+            db.session.query(Dashboard)
+            .filter(Dashboard.dashboard_title == "World Bank's Data")
+            .first()
+        )
+        chart = db.session.query(Slice).first()
+        tags = ["tag1", "tag2", "tag3"]
+        rv = self.client.post(
+            uri,
+            json={
+                "tags": ["tag1", "tag2", "tag3"],
+                "objects_to_tag": [["dashboard", dashboard.id], ["chart", 
chart.id]],

Review Comment:
   I like this pattern too @zephyring. Because it's a bigger change, we'll do a 
fast-follow so that we can merge this pr.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscr...@superset.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscr...@superset.apache.org
For additional commands, e-mail: notifications-h...@superset.apache.org

Reply via email to