forked from mirrors/bookwyrm
Fixes tests
This commit is contained in:
parent
6b07911a01
commit
bbc05578fb
5 changed files with 6 additions and 5 deletions
|
@ -30,7 +30,7 @@ class BookList(OrderedCollectionPrivate):
|
|||
''' structure of an ordered collection activity '''
|
||||
summary: str = None
|
||||
curation: str = 'closed'
|
||||
type: str = 'List'
|
||||
type: str = 'BookList'
|
||||
|
||||
|
||||
@dataclass(init=False)
|
||||
|
|
|
@ -131,7 +131,7 @@ class User(OrderedCollectionPageMixin, AbstractUser):
|
|||
privacy__in=['public', 'unlisted'],
|
||||
).select_subclasses().order_by('-published_date')
|
||||
return self.to_ordered_collection(queryset, \
|
||||
remote_id=self.outbox, **kwargs)
|
||||
collection_only=True, remote_id=self.outbox, **kwargs)
|
||||
|
||||
def to_following_activity(self, **kwargs):
|
||||
''' activitypub following list '''
|
||||
|
@ -266,6 +266,7 @@ class AnnualGoal(BookWyrmModel):
|
|||
|
||||
@property
|
||||
def progress_percent(self):
|
||||
''' how close to your goal, in percent form '''
|
||||
return int(float(self.book_count / self.goal) * 100)
|
||||
|
||||
|
||||
|
|
|
@ -27,7 +27,7 @@ class List(TestCase):
|
|||
self.assertIsInstance(activity_json, dict)
|
||||
self.assertEqual(activity_json['id'], self.list.remote_id)
|
||||
self.assertEqual(activity_json['totalItems'], 0)
|
||||
self.assertEqual(activity_json['type'], 'OrderedCollection')
|
||||
self.assertEqual(activity_json['type'], 'BookList')
|
||||
self.assertEqual(activity_json['name'], 'Test List')
|
||||
self.assertEqual(activity_json['owner'], self.user.remote_id)
|
||||
|
||||
|
|
|
@ -26,6 +26,6 @@ class Shelf(TestCase):
|
|||
self.assertIsInstance(activity_json, dict)
|
||||
self.assertEqual(activity_json['id'], self.shelf.remote_id)
|
||||
self.assertEqual(activity_json['totalItems'], 0)
|
||||
self.assertEqual(activity_json['type'], 'OrderedCollection')
|
||||
self.assertEqual(activity_json['type'], 'Shelf')
|
||||
self.assertEqual(activity_json['name'], 'Test Shelf')
|
||||
self.assertEqual(activity_json['owner'], self.user.remote_id)
|
||||
|
|
|
@ -10,7 +10,7 @@ class User(TestCase):
|
|||
def setUp(self):
|
||||
self.user = models.User.objects.create_user(
|
||||
'mouse@%s' % DOMAIN, 'mouse@mouse.mouse', 'mouseword',
|
||||
local=True, localname='mouse')
|
||||
local=True, localname='mouse', name='hi')
|
||||
|
||||
def test_computed_fields(self):
|
||||
''' username instead of id here '''
|
||||
|
|
Loading…
Reference in a new issue