docstr: CSS Template API: Test get list and custom filter
docstr_tok: ["CSS","Template","API",":","Test","get","list","and","custom","filter"]
code: def test_get_list_custom_filter_css_template(self):
      """
      CSS Template API: Test get list and custom filter
      """
      self.login(username="admin")
  
      all_css_templates = (
          db.session.query(CssTemplate)
          .filter(CssTemplate.css.ilike("%css2%"))
          .all()
      )
      query_string = {
          "filters": [
              {
                  "col": "template_name",
                  "opr": "css_template_all_text",
                  "value": "css2",
              }
          ],
      }
      uri = f"api/v1/css_template/?q={prison.dumps(query_string)}"
      rv = self.get_assert_metric(uri, "get_list")
      assert rv.status_code == 200
      data = json.loads(rv.data.decode("utf-8"))
      assert data["count"] == len(all_css_templates)
  
      all_css_templates = (
          db.session.query(CssTemplate)
          .filter(CssTemplate.template_name.ilike("%template_name3%"))
          .all()
      )
      query_string = {
          "filters": [
              {
                  "col": "template_name",
                  "opr": "css_template_all_text",
                  "value": "template_name3",
              }
          ],
      }
      uri = f"api/v1/css_template/?q={prison.dumps(query_string)}"
      rv = self.get_assert_metric(uri, "get_list")
      assert rv.status_code == 200
      data = json.loads(rv.data.decode("utf-8"))
      assert data["count"] == len(all_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 5 for calling the TestCssTemplateApi obj's underlying member method code with example usage: obj.test_get_list_custom_filter_css_template() without return types