kopia lustrzana https://github.com/snarfed/bridgy-fed
user page redesign: feeds bug fix, fix tests
rodzic
11037d80df
commit
cc62d4cdb1
6
pages.py
6
pages.py
|
@ -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'
|
||||
|
|
|
@ -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/'))
|
||||
|
||||
|
|
|
@ -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()
|
||||
|
|
|
@ -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')
|
||||
|
|
Ładowanie…
Reference in New Issue