diff --git a/superset/dashboards/schemas.py b/superset/dashboards/schemas.py index 5f054fe134..7ca592e8a3 100644 --- a/superset/dashboards/schemas.py +++ b/superset/dashboards/schemas.py @@ -159,6 +159,7 @@ class DashboardGetResponseSchema(Schema): owners = fields.List(fields.Nested(UserSchema)) roles = fields.List(fields.Nested(RolesSchema)) table_names = fields.String() # legacy nonsense + changed_on_humanized = fields.String(data_key="changed_on_delta_humanized") class DatabaseSchema(Schema): diff --git a/tests/integration_tests/dashboards/api_tests.py b/tests/integration_tests/dashboards/api_tests.py index 8bd1ca1b0f..cfb65d3a66 100644 --- a/tests/integration_tests/dashboards/api_tests.py +++ b/tests/integration_tests/dashboards/api_tests.py @@ -344,9 +344,10 @@ class TestDashboardApi(SupersetTestCase, ApiOwnersTestCaseMixin, InsertChartMixi } data = json.loads(rv.data.decode("utf-8")) self.assertIn("changed_on", data["result"]) + self.assertIn("changed_on_delta_humanized", data["result"]) for key, value in data["result"].items(): # 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]) # rollback changes db.session.delete(dashboard)