kjcioffi / django-showtime-plus

Showtime+ is a streamlined platform designed to provide just enough information about movies currently in theaters, all in one place.
https://www.showtime-plus.com/
Mozilla Public License 2.0
2 stars 0 forks source link

Check for success status to validate a successful test. #15

Closed ryaustin closed 3 months ago

ryaustin commented 3 months ago
          To make this test more robust, it might be worthwhile to ensure there are no errors. 

When I ran this test it passed successfully - which I expected to fail since I don't have the API key set yet. Here is the resolve of self.movies_in_context: {'status_code': 7, 'status_message': 'Invalid API key: You must be granted a valid key.', 'success': False}

So how can you 1: make the test more robust? Does it make sense to test a scenario where there is no API key (success: False)?

_Originally posted by @ryaustin in https://github.com/kjcioffi/django-movies/pull/14#discussion_r1633886932_

kjcioffi commented 3 months ago

The movie API utility module was refactored with logic added to the test suite to provide coverage.