mirror of
https://github.com/bookwyrm-social/bookwyrm.git
synced 2024-12-25 01:20:35 +00:00
Updates goal and list tests
This commit is contained in:
parent
6c0b1da83b
commit
56bf8d923f
2 changed files with 5 additions and 3 deletions
|
@ -3,6 +3,7 @@ from unittest.mock import patch
|
||||||
from django.utils import timezone
|
from django.utils import timezone
|
||||||
|
|
||||||
from django.contrib.auth.models import AnonymousUser
|
from django.contrib.auth.models import AnonymousUser
|
||||||
|
from django.http import Http404
|
||||||
from django.template.response import TemplateResponse
|
from django.template.response import TemplateResponse
|
||||||
from django.test import TestCase
|
from django.test import TestCase
|
||||||
from django.test.client import RequestFactory
|
from django.test.client import RequestFactory
|
||||||
|
@ -103,8 +104,8 @@ class GoalViews(TestCase):
|
||||||
request = self.factory.get("")
|
request = self.factory.get("")
|
||||||
request.user = self.rat
|
request.user = self.rat
|
||||||
|
|
||||||
result = view(request, self.local_user.localname, self.year)
|
with self.assertRaises(Http404):
|
||||||
self.assertEqual(result.status_code, 404)
|
view(request, self.local_user.localname, self.year)
|
||||||
|
|
||||||
@patch("bookwyrm.activitystreams.add_status_task.delay")
|
@patch("bookwyrm.activitystreams.add_status_task.delay")
|
||||||
def test_create_goal(self, _):
|
def test_create_goal(self, _):
|
||||||
|
|
|
@ -568,5 +568,6 @@ class ListActionViews(TestCase):
|
||||||
)
|
)
|
||||||
request.user = self.rat
|
request.user = self.rat
|
||||||
|
|
||||||
|
with self.assertRaises(PermissionDenied):
|
||||||
views.list.remove_book(request, self.list.id)
|
views.list.remove_book(request, self.list.id)
|
||||||
self.assertTrue(self.list.listitem_set.exists())
|
self.assertTrue(self.list.listitem_set.exists())
|
||||||
|
|
Loading…
Reference in a new issue