diff --git a/swh/storage/cassandra/storage.py b/swh/storage/cassandra/storage.py --- a/swh/storage/cassandra/storage.py +++ b/swh/storage/cassandra/storage.py @@ -228,6 +228,7 @@ if counter >= limit: next_page_token = str(tok) break + row_d["ctime"] = row.ctime.replace(tzinfo=datetime.timezone.utc) contents.append(Content(**row_d)) assert len(contents) <= limit diff --git a/swh/storage/tests/storage_tests.py b/swh/storage/tests/storage_tests.py --- a/swh/storage/tests/storage_tests.py +++ b/swh/storage/tests/storage_tests.py @@ -2981,6 +2981,8 @@ actually_present = swh_storage.content_find({"sha1": content.sha1}) assert actually_present[0] == content + assert actually_present[0].ctime is not None + assert actually_present[0].ctime.tzinfo is not None def test_content_find_with_present_content(self, swh_storage, sample_data): content = sample_data.content