def test_resource_timestamp_is_depracated(self): with mock.patch("kinto.core.resource.schema.warnings") as mocked: schema.TimeStamp() message = ("`kinto.core.resource.schema.TimeStamp` is deprecated, " "use `kinto.core.schema.TimeStamp` instead.") mocked.warn.assert_called_with(message, DeprecationWarning)
def test_default_value_comes_from_timestamper(self, time_mocked): time_mocked.return_value = 666 default = schema.TimeStamp().deserialize(colander.null) self.assertEqual(default, 666)