diff --git a/synapse/types/__init__.py b/synapse/types/__init__.py index b42893e39d..e901210e65 100644 --- a/synapse/types/__init__.py +++ b/synapse/types/__init__.py @@ -1651,7 +1651,7 @@ class UserInfo: consent_server_notice_sent: Version of policy documents the user has been sent. consent_version: Version of policy documents the user has consented to. consent_ts: Time the user consented - creation_ts: Creation timestamp of the user. + creation_ts: Creation timestamp of the user (in seconds). is_admin: True if the user is an admin. is_deactivated: True if the user has been deactivated. is_guest: True if the user is a guest user. diff --git a/tests/module_api/test_api.py b/tests/module_api/test_api.py index b4b14c87b9..89aadd09d4 100644 --- a/tests/module_api/test_api.py +++ b/tests/module_api/test_api.py @@ -85,6 +85,7 @@ class ModuleApiTestCase(BaseModuleApiTestCase): def test_can_register_user(self) -> None: """Tests that an external module can register a user""" # Register a new user + register_ts = int(self.clock.time_msec()) user_id, access_token = self.get_success( self.module_api.register( "bob", displayname="Bobberino", emails=["bob@bobinator.bob"] @@ -105,8 +106,8 @@ class ModuleApiTestCase(BaseModuleApiTestCase): self.assertEqual(email.address, "bob@bobinator.bob") # Should these be 0? - self.assertEqual(email.validated_at, 0) - self.assertEqual(email.added_at, 0) + self.assertEqual(email.validated_at, register_ts) + self.assertEqual(email.added_at, register_ts) # Check that the displayname was assigned displayname = self.get_success( diff --git a/tests/storage/test_registration.py b/tests/storage/test_registration.py index 7ee81fabb6..5a5624f272 100644 --- a/tests/storage/test_registration.py +++ b/tests/storage/test_registration.py @@ -39,6 +39,7 @@ class RegistrationStoreTestCase(HomeserverTestCase): self.device_id = "akgjhdjklgshg" def test_register(self) -> None: + register_ts_seconds = int(self.clock.time()) self.get_success(self.store.register_user(self.user_id, self.pwhash)) self.assertEqual( @@ -50,7 +51,7 @@ class RegistrationStoreTestCase(HomeserverTestCase): consent_ts=None, consent_version=None, appservice_id=None, - creation_ts=0, + creation_ts=register_ts_seconds, user_type=None, is_deactivated=False, locked=False,