mirror of
https://github.com/apache/superset.git
synced 2026-04-21 17:14:57 +00:00
chore: harmonize and clean up list views (#25961)
This commit is contained in:
@@ -19,6 +19,8 @@
|
||||
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
|
||||
@@ -189,20 +191,27 @@ class TestCssTemplateApi(SupersetTestCase):
|
||||
"""
|
||||
CSS Template API: Test get CSS Template
|
||||
"""
|
||||
css_template = (
|
||||
db.session.query(CssTemplate)
|
||||
.filter(CssTemplate.template_name == "template_name1")
|
||||
.one_or_none()
|
||||
)
|
||||
self.login(username="admin")
|
||||
uri = f"api/v1/css_template/{css_template.id}"
|
||||
rv = self.get_assert_metric(uri, "get")
|
||||
with freeze_time(datetime.now()):
|
||||
css_template = (
|
||||
db.session.query(CssTemplate)
|
||||
.filter(CssTemplate.template_name == "template_name1")
|
||||
.one_or_none()
|
||||
)
|
||||
self.login(username="admin")
|
||||
uri = f"api/v1/css_template/{css_template.id}"
|
||||
rv = self.get_assert_metric(uri, "get")
|
||||
assert rv.status_code == 200
|
||||
|
||||
expected_result = {
|
||||
"id": css_template.id,
|
||||
"template_name": "template_name1",
|
||||
"css": "css1",
|
||||
"changed_by": {
|
||||
"first_name": css_template.created_by.first_name,
|
||||
"id": css_template.created_by.id,
|
||||
"last_name": css_template.created_by.last_name,
|
||||
},
|
||||
"changed_on_delta_humanized": "now",
|
||||
"created_by": {
|
||||
"first_name": css_template.created_by.first_name,
|
||||
"id": css_template.created_by.id,
|
||||
|
||||
Reference in New Issue
Block a user