Updates goal and list tests

This commit is contained in:
Mouse Reeve 2021-09-27 17:52:10 -07:00
parent 6c0b1da83b
commit 56bf8d923f
2 changed files with 5 additions and 3 deletions

View file

@ -3,6 +3,7 @@ from unittest.mock import patch
from django.utils import timezone
from django.contrib.auth.models import AnonymousUser
from django.http import Http404
from django.template.response import TemplateResponse
from django.test import TestCase
from django.test.client import RequestFactory
@ -103,8 +104,8 @@ class GoalViews(TestCase):
request = self.factory.get("")
request.user = self.rat
result = view(request, self.local_user.localname, self.year)
self.assertEqual(result.status_code, 404)
with self.assertRaises(Http404):
view(request, self.local_user.localname, self.year)
@patch("bookwyrm.activitystreams.add_status_task.delay")
def test_create_goal(self, _):

View file

@ -568,5 +568,6 @@ class ListActionViews(TestCase):
)
request.user = self.rat
views.list.remove_book(request, self.list.id)
with self.assertRaises(PermissionDenied):
views.list.remove_book(request, self.list.id)
self.assertTrue(self.list.listitem_set.exists())