Fixed test cases + error return status code#360
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #360 +/- ##
==========================================
+ Coverage 84.54% 88.82% +4.28%
==========================================
Files 73 73
Lines 3177 3177
==========================================
+ Hits 2686 2822 +136
+ Misses 491 355 -136 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Pull Request Overview
This PR fixes test cases by updating expiration dates from 2025 to 3000 for proper test isolation, removes obsolete test data, and corrects error response status codes in the market API.
- Changed all test data expiration dates from 2025 to 3000 to ensure future-proof testing
- Removed
user_2_items.jsontest file that was no longer needed - Updated error responses to return proper 400 status codes instead of 406 for validation errors
Reviewed Changes
Copilot reviewed 9 out of 10 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
backend/tests/market/user_2_items.json |
Removed obsolete test data file |
backend/tests/market/user_1_sublets.json |
Updated expiration dates to year 3000 |
backend/tests/market/user_1_items.json |
Updated expiration dates to year 3000 |
backend/tests/market/test_market.py |
Major test refactoring with new base class and updated test cases |
backend/tests/market/self_user_sublets.json |
Updated expiration dates to year 3000 |
backend/tests/market/self_user_items.json |
Updated expiration dates to year 3000 |
backend/tests/market/mock_sublets.json |
Updated expiration dates to year 3000 |
backend/tests/market/mock_items.json |
Updated expiration dates to year 3000 |
backend/market/views.py |
Fixed error response status codes from 406 to 400 |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
|
|
||
| def test_delete_offer_nonexistent(self): | ||
| response = self.client.delete("/market/items/6/offers/") | ||
| def test_delete_nonexistant_favorite(self): |
There was a problem hiding this comment.
"nonexistant" should be spelled "nonexistent".
| def test_delete_nonexistant_favorite(self): | |
| def test_delete_nonexistent_favorite(self): |
dr-Jess
left a comment
There was a problem hiding this comment.
1-2 small changes off being done. Good stuff and thanks for handling this!
| class TestMarket(TestCase): | ||
|
|
||
| class BaseMarketTest(TestCase): | ||
| def setUp(self): |
There was a problem hiding this comment.
We ought to maximize the amount of setup that is done here as opposed to copying code between each case. Please go through each case and find as much shared/stuff you can put here as possible :)
* Fixed test cases + error return status code * fixed failing tests * fixed test case * increased codecov * uncommented shit * fix tests * removed unused stuff, increased shared setup
No description provided.