mirror of https://github.com/apache/superset.git
chore: add changed_on_delta_humanized field on dashboard schema (#15542)
* chore: add changed_on_delta_humanized field on dashboard schema * fix ut
This commit is contained in:
parent
58cda8f8d6
commit
ae160f7f21
|
@ -159,6 +159,7 @@ class DashboardGetResponseSchema(Schema):
|
||||||
owners = fields.List(fields.Nested(UserSchema))
|
owners = fields.List(fields.Nested(UserSchema))
|
||||||
roles = fields.List(fields.Nested(RolesSchema))
|
roles = fields.List(fields.Nested(RolesSchema))
|
||||||
table_names = fields.String() # legacy nonsense
|
table_names = fields.String() # legacy nonsense
|
||||||
|
changed_on_humanized = fields.String(data_key="changed_on_delta_humanized")
|
||||||
|
|
||||||
|
|
||||||
class DatabaseSchema(Schema):
|
class DatabaseSchema(Schema):
|
||||||
|
|
|
@ -344,9 +344,10 @@ class TestDashboardApi(SupersetTestCase, ApiOwnersTestCaseMixin, InsertChartMixi
|
||||||
}
|
}
|
||||||
data = json.loads(rv.data.decode("utf-8"))
|
data = json.loads(rv.data.decode("utf-8"))
|
||||||
self.assertIn("changed_on", data["result"])
|
self.assertIn("changed_on", data["result"])
|
||||||
|
self.assertIn("changed_on_delta_humanized", data["result"])
|
||||||
for key, value in data["result"].items():
|
for key, value in data["result"].items():
|
||||||
# We can't assert timestamp values
|
# We can't assert timestamp values
|
||||||
if key != "changed_on":
|
if key not in ("changed_on", "changed_on_delta_humanized",):
|
||||||
self.assertEqual(value, expected_result[key])
|
self.assertEqual(value, expected_result[key])
|
||||||
# rollback changes
|
# rollback changes
|
||||||
db.session.delete(dashboard)
|
db.session.delete(dashboard)
|
||||||
|
|
Loading…
Reference in New Issue