Add LoginRequiredMiddleware to make (almost) every URL login required by default

This commit is contained in:
Neil Martinsen-Burrell 2023-06-01 16:03:31 -05:00
parent a54f804f4d
commit ae3ba84f1a
No known key found for this signature in database
GPG key ID: 6A3C818CC10D0184
8 changed files with 48 additions and 26 deletions

View file

@ -104,6 +104,9 @@ class AvailableAPITest(TestCase):
def test_available_post(self):
"""Cannot post to the /available/ API endpoint."""
# have to log in to test the correct thing now that we require login
# for all URLs by default
self.client.force_login(self.user)
with less_console_noise():
response = self.client.post(API_BASE_PATH + "nonsense")
self.assertEqual(response.status_code, 405)