UI for adding and removing authors
This commit is contained in:
@ -83,6 +83,22 @@ class BookViews(TestCase):
|
||||
self.assertEqual(self.book.title, 'New Title')
|
||||
|
||||
|
||||
def test_edit_book_add_author(self):
|
||||
''' lets a user edit a book '''
|
||||
view = views.EditBook.as_view()
|
||||
self.local_user.groups.add(self.group)
|
||||
form = forms.EditionForm(instance=self.book)
|
||||
form.data['title'] = 'New Title'
|
||||
form.data['last_edited_by'] = self.local_user.id
|
||||
form.data['add_author'] = "John Doe"
|
||||
request = self.factory.post('', form.data)
|
||||
request.user = self.local_user
|
||||
with patch('bookwyrm.models.activitypub_mixin.broadcast_task.delay'):
|
||||
view(request, self.book.id)
|
||||
self.book.refresh_from_db()
|
||||
self.assertEqual(self.book.title, 'New Title')
|
||||
|
||||
|
||||
def test_switch_edition(self):
|
||||
''' updates user's relationships to a book '''
|
||||
work = models.Work.objects.create(title='test work')
|
||||
|
Reference in New Issue
Block a user