def test_sync(self): with authenticated_user(self.client) as user: rv = self.client.get('/default/') timestamp = dt_from_timestamp(redis_connection.hget(LAST_ACTIVE_KEY, user.id)) sync_last_active_at() user_reloaded = User.query.filter(User.id==user.id).first() self.assertIn('active_at', user_reloaded.details) self.assertEqual(user_reloaded.active_at, timestamp)
def sync_user_details(): users.sync_last_active_at()