Test for PermissionDenied error, not isNone

This commit is contained in:
Mouse Reeve 2022-07-14 11:45:59 -07:00
parent 4f1283ff52
commit 73c4a01a6e

View file

@ -183,9 +183,9 @@ class ShelfActionViews(TestCase):
request = self.factory.post("", form.data)
request.user = self.local_user
views.create_shelf(request)
with self.assertRaises(PermissionDenied):
views.create_shelf(request)
self.assertIsNone(models.Shelf.objects.filter(name="new shelf name"))
def test_delete_shelf(self, *_):
"""delete a brand new custom shelf"""