Test updating a progress

Also remove spurious whitespace change
This commit is contained in:
Joel Bradshaw 2020-11-27 18:17:32 -08:00
parent 6455cc7fe9
commit 9ed7d23000
2 changed files with 13 additions and 0 deletions

View file

@ -210,6 +210,7 @@ class Quotation(Status):
activity_serializer = activitypub.Quotation activity_serializer = activitypub.Quotation
pure_activity_serializer = activitypub.Note pure_activity_serializer = activitypub.Note
class Review(Status): class Review(Status):
''' a book review ''' ''' a book review '''
name = models.CharField(max_length=255, null=True) name = models.CharField(max_length=255, null=True)

View file

@ -58,3 +58,15 @@ class ReadThrough(TestCase):
self.assertEqual(len(progress_updates), 1) self.assertEqual(len(progress_updates), 1)
self.assertEqual(progress_updates[0].mode, models.ProgressMode.PAGE) self.assertEqual(progress_updates[0].mode, models.ProgressMode.PAGE)
self.assertEqual(progress_updates[0].progress, 50) self.assertEqual(progress_updates[0].progress, 50)
# Update progress
self.client.post('/edit-readthrough', {
'id': readthroughs[0].id,
'pages_read': 100,
})
progress_updates = readthroughs[0].progressupdate_set\
.order_by('updated_date').all()
self.assertEqual(len(progress_updates), 2)
self.assertEqual(progress_updates[1].mode, models.ProgressMode.PAGE)
self.assertEqual(progress_updates[1].progress, 100)