|
@@ -181,3 +181,9 @@ class SentryNotFoundReportingTestCase(TestCase):
|
|
|
self.assertEqual(response.status_code, 301)
|
|
self.assertEqual(response.status_code, 301)
|
|
|
self.assertEqual(response.headers['Location'], '/api/status/')
|
|
self.assertEqual(response.headers['Location'], '/api/status/')
|
|
|
self.sentry_sdk.capture_message.assert_not_called()
|
|
self.sentry_sdk.capture_message.assert_not_called()
|
|
|
|
|
+
|
|
|
|
|
+ def test_unsafe_api_request_without_slash_reported_to_sentry(self):
|
|
|
|
|
+ response = self.client.post('/api/status', data={}, content_type='application/json')
|
|
|
|
|
+
|
|
|
|
|
+ self.assertEqual(response.status_code, 404)
|
|
|
|
|
+ self.sentry_sdk.capture_message.assert_called_once_with('Page not found', level='error')
|