-
Notifications
You must be signed in to change notification settings - Fork 16
return a 404 if a news slug is not found #1107
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Codecov Report
@@ Coverage Diff @@
## master #1107 +/- ##
==========================================
+ Coverage 82.52% 82.55% +0.02%
==========================================
Files 369 369
Lines 6388 6396 +8
==========================================
+ Hits 5272 5280 +8
Misses 1116 1116 |
|
||
def bad_slug_returns_404(self): | ||
response = self.client.get('/apps/cms/api/news/bad-slug/', format='json') | ||
self.assertEqual(response.status_code, 404) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
codecov has officially lost its mind if it's complaining that I am not testing the tests...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does it mean that test is never run?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@RoyEJohnson, the Travis whisperer™️. That's exactly what's happening... I'll investigate.
|
||
def bad_slug_returns_404(self): | ||
response = self.client.get('/apps/cms/api/news/bad-slug/', format='json') | ||
self.assertEqual(response.status_code, 404) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does it mean that test is never run?
There are a lot of errors in Sentry where bots... or something... are trying to find news articles that do not exist. This appropriately returns a 404, instead of 500.
Example Sentry issue: https://sentry.cnx.org/openstax/cms/issues/303262/