Commit 19f263b
authored
Merge pull request #50 from RandomProgramm3r/develop
test: Add comprehensive tests for PromoComment
This commit introduces a new test suite, `PromoCommentsTestCase`, to provide robust test coverage for the promo comments API endpoints.
Key functionality covered:
- **CRUD Operations**: Full lifecycle testing for creating (POST), retrieving (GET list/detail), updating (PUT), and deleting (DELETE) comments.
- **Permissions**: Verifies that users can only modify or delete their own comments (403 Forbidden).
- **Error Handling**: Validates correct 404 Not Found responses for invalid requests, such as mismatched promo and comment IDs.
- **Data Integrity**: Ensures the `comment_count` on the parent Promo object is correctly updated after comments are created or deleted.
- **Listing & Pagination**: Confirms that comments are listed in reverse chronological order and that pagination headers (`X-Total-Count`) are accurate.File tree
2 files changed
+499
-1
lines changed- promo_code/user/tests/user
- operations
2 files changed
+499
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
68 | 68 | | |
69 | 69 | | |
70 | 70 | | |
71 | | - | |
| 71 | + | |
72 | 72 | | |
| 73 | + | |
73 | 74 | | |
74 | 75 | | |
75 | 76 | | |
| |||
0 commit comments