user page redesign: feeds bug fix, fix tests

pull/671/head
Ryan Barrett 2023-10-10 15:43:29 -07:00
rodzic 11037d80df
commit cc62d4cdb1
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 6BE31FDF4776E9D4
4 zmienionych plików z 6 dodań i 8 usunięć

Wyświetl plik

@ -169,12 +169,8 @@ def feed(protocol, id):
load_user(protocol, id)
query = Object.query(Object.feed == g.user.key)
# .order(-Object.created) \
# .fetch(PAGE_SIZE)
# activities = [obj.as1 for obj in objects if not obj.deleted]
objects, _, _ = fetch_objects(query, by=Object.created)
activities = [obj.as1 for obj in objects]
activities = [obj.as1 for obj in objects if not obj.deleted]
# hydrate authors, actors, objects from stored Objects
fields = 'author', 'actor', 'object'

Wyświetl plik

@ -34,7 +34,7 @@ class CommonTest(TestCase):
self.assert_multiline_equals("""\
<a class="h-card u-author" href="https://user.com/">
<img src="" class="profile">
<span class="logo" title="{self.__class__.__name__}">🕸</span>
<span class="logo" title="Web">🕸</span>
user.com
</a>""", common.pretty_link('https://user.com/'))

Wyświetl plik

@ -33,7 +33,7 @@ def contents(activities):
class PagesTest(TestCase):
EXPECTED = contents([COMMENT, NOTE, NOTE])
EXPECTED = contents([COMMENT, MENTION, NOTE])
def setUp(self):
super().setUp()

Wyświetl plik

@ -47,6 +47,7 @@ MENTION = {
**MENTION,
# author object with just id
'author': {'id': ACTOR['id']},
'content': 'a mention',
}
COMMENT = {
**COMMENT,
@ -55,6 +56,7 @@ COMMENT = {
**ACTOR,
'displayName': 'Dr. Eve',
},
'content': 'a comment',
}
@ -314,7 +316,7 @@ class TestCase(unittest.TestCase, testutil.Asserts):
self.store_object(id='f',
notify=[user],
feed=[user],
our_as1=NOTE,
our_as1={**NOTE, 'content': 'deleted!'},
deleted=True)
# different domain
nope = ndb.Key(Web, 'nope.org')