From 6a951138dce069a462faa997a1e72ae502e64b58 Mon Sep 17 00:00:00 2001 From: Ryan Barrett Date: Sat, 23 Sep 2023 14:55:49 -0700 Subject: [PATCH] oops, need to implement Web.profile_id after all Web user ids are domains, eg user.com, but "web id" of a user profile is a full homepage url, eg https://user.com/ --- tests/test_web.py | 3 +++ web.py | 2 ++ 2 files changed, 5 insertions(+) diff --git a/tests/test_web.py b/tests/test_web.py index 2efe94c..a02ce47 100644 --- a/tests/test_web.py +++ b/tests/test_web.py @@ -1913,6 +1913,9 @@ class WebUtilTest(TestCase): def test_handle_to_id(self, *_): self.assertEqual('foo.com', Web.handle_to_id('foo.com')) + def test_profile_id(self, *_): + self.assertEqual('https://foo.com/', Web(id='foo.com').profile_id()) + def test_fetch(self, mock_get, __): mock_get.return_value = REPOST diff --git a/web.py b/web.py index 061f8e4..0ad7342 100644 --- a/web.py +++ b/web.py @@ -104,6 +104,8 @@ class Web(User, Protocol): """Returns this user's web URL aka web_url, eg 'https://foo.com/'.""" return f'https://{self.key.id()}/' + profile_id = web_url + def ap_address(self): """Returns this user's ActivityPub address, eg '@foo.com@foo.com'.