kopia lustrzana https://gitlab.com/marnanel/chapeau
Sort out model identifiers in things_for_testing
rodzic
132932d6c8
commit
7b5408ed4c
|
@ -169,7 +169,11 @@ class CollectionTests(TestCase):
|
|||
path=path,
|
||||
page_number=1,
|
||||
expectedTotalItems=3,
|
||||
expectedOnPage=['alice', 'bob', 'carol'],
|
||||
expectedOnPage=[
|
||||
'https://example.com/user/alice',
|
||||
'https://example.com/user/bob',
|
||||
'https://example.com/user/carol',
|
||||
],
|
||||
)
|
||||
|
||||
for name in ['alice', 'bob', 'carol']:
|
||||
|
@ -185,7 +189,9 @@ class CollectionTests(TestCase):
|
|||
path=path,
|
||||
page_number=1,
|
||||
expectedTotalItems=1,
|
||||
expectedOnPage=['alice'],
|
||||
)
|
||||
expectedOnPage=[
|
||||
'https://example.com/user/alice',
|
||||
],
|
||||
)
|
||||
|
||||
|
||||
|
|
|
@ -15,23 +15,23 @@ class ThingUserFollowingView(CollectionView):
|
|||
def get_collection_items(self, *args, **kwargs):
|
||||
return Activity.objects.filter(
|
||||
f_type='Follow',
|
||||
f_actor=ThingUser(name=kwargs['name']).url,
|
||||
f_actor=ThingUser(name=kwargs['name']).activity_id,
|
||||
accepted=True,
|
||||
)
|
||||
|
||||
def _stringify_object(self, obj):
|
||||
return ThingUser.objects.get(actor=obj.following).url
|
||||
return obj.f_object
|
||||
|
||||
class ThingUserFollowersView(CollectionView):
|
||||
|
||||
def get_collection_items(self, *args, **kwargs):
|
||||
return Activity.objects.filter(
|
||||
f_type='Follow',
|
||||
f_object=ThingUser(name=kwargs['name']).url,
|
||||
f_object=ThingUser(name=kwargs['name']).activity_id,
|
||||
accepted=True,
|
||||
)
|
||||
|
||||
def _stringify_object(self, obj):
|
||||
return ThingUser.objects.get(actor=obj.follower).url
|
||||
return obj.f_actor
|
||||
|
||||
|
||||
|
|
Ładowanie…
Reference in New Issue