docstr: CSS Template API: Test create
docstr_tok: ["CSS","Template","API",":","Test","create"]
code: def test_create_css_template(self):
      """
      CSS Template API: Test create
      """
      post_data = {
          "template_name": "template_name_create",
          "css": "css_create",
      }
  
      self.login(username="admin")
      uri = f"api/v1/css_template/"
      rv = self.post_assert_metric(uri, post_data, "post")
      data = json.loads(rv.data.decode("utf-8"))
      assert rv.status_code == 201
  
      css_template_id = data.get("id")
      model = db.session.query(CssTemplate).get(css_template_id)
      for key in post_data:
          assert getattr(model, key) == data["result"][key]
  
      # Rollback changes
      db.session.delete(model)
      db.session.commit()
  
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 10 for calling the TestCssTemplateApi obj's underlying member method code with example usage: obj.test_create_css_template() without return types