docstr: CSS Template API: Test delete bulk
docstr_tok: ["CSS","Template","API",":","Test","delete","bulk"]
code: def test_delete_bulk_css_templates(self):
      """
      CSS Template API: Test delete bulk
      """
      css_templates = db.session.query(CssTemplate).all()
      css_template_ids = [
          css_template.id for css_template in css_templates
      ]
  
      self.login(username="admin")
      uri = f"api/v1/css_template/?q={prison.dumps(css_template_ids)}"
      rv = self.delete_assert_metric(uri, "bulk_delete")
      assert rv.status_code == 200
      response = json.loads(rv.data.decode("utf-8"))
      expected_response = {
          "message": f"Deleted {len(css_template_ids)} css templates"
      }
      assert response == expected_response
      css_templates = db.session.query(CssTemplate).all()
      assert css_templates == []
  
imports: import json
  import pytest
  import prison
  from datetime import datetime
  from freezegun import freeze_time
  from sqlalchemy.sql import func
  import tests.integration_tests.test_app
  from superset import db
  from superset.models.core import CssTemplate
  from superset.utils.database import get_example_database
  from tests.integration_tests.base_tests import SupersetTestCase
label_desc: Use image node_id 15 for calling the TestCssTemplateApi obj's underlying member method code with example usage: obj.test_delete_bulk_css_templates() without return types