Skip to content

Conversation

mwvolo
Copy link
Member

@mwvolo mwvolo commented Dec 7, 2020

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/

@codecov
Copy link

codecov bot commented Dec 7, 2020

Codecov Report

Merging #1107 (1673f34) into master (695fa41) will increase coverage by 0.02%.
The diff coverage is 100.00%.

@@            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)
Copy link
Member Author

@mwvolo mwvolo Dec 7, 2020

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...

Copy link
Contributor

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?

Copy link
Member Author

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.

@mwvolo mwvolo requested a review from RoyEJohnson December 9, 2020 14:08

def bad_slug_returns_404(self):
response = self.client.get('/apps/cms/api/news/bad-slug/', format='json')
self.assertEqual(response.status_code, 404)
Copy link
Contributor

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?

@mwvolo mwvolo merged commit 802daad into master Dec 11, 2020
@mwvolo mwvolo deleted the fix-news-slug-404 branch December 11, 2020 19:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants