Adds test for editing shelf

This commit is contained in:
Mouse Reeve
2021-01-11 14:23:56 -08:00
parent 7e2460955d
commit 8d88c768cc
2 changed files with 18 additions and 3 deletions

View File

@ -360,6 +360,22 @@ class ViewActions(TestCase):
self.assertEqual(resp.template_name, 'edit_author.html')
def test_edit_shelf(self):
''' set name or privacy on shelf '''
shelf = self.local_user.shelf_set.get(identifier='to-read')
self.assertEqual(shelf.privacy, 'public')
request = self.factory.post(
'', {
'privacy': 'unlisted',
'user': self.local_user.id,
})
request.user = self.local_user
actions.edit_shelf(request, shelf.id)
self.assertEqual(shelf.privacy, 'unlisted')
def test_edit_readthrough(self):
''' adding dates to an ongoing readthrough '''
start = timezone.make_aware(dateutil.parser.parse('2021-01-03'))