Commit da26418
authored
Merge pull request #54 from RandomProgramm3r/develop
test: Add comprehensive tests for user promo operations
This commit introduces a suite of tests for the user-facing promo code functionality, ensuring robustness and correctness.
The new tests cover the following areas:
- Promo Code Activation:
- Verification of activation logic, including success and failure scenarios for common and unique promos.
- Edge cases such as inactive promos, targeting mismatches, and exhausted activation limits (max_count).
- Checks to prevent users who are blocked by the anti-fraud service from activating promos.
- Promo Activation History:
- Tests for the user's promo activation history endpoint.
- Validation of the returned data and its order.
- Pagination functionality (limit and offset).
- Anti-Fraud Service Integration:
- Unit tests for the AntiFraudService to verify its caching behavior and resilience to external service failures.
- Integration tests to confirm that the promo activation process correctly respects the anti-fraud service's verdicts, including delayed updates from the cache.File tree
5 files changed
+934
-2
lines changed- promo_code/user/tests/user
- operations
5 files changed
+934
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
1 | 3 | | |
| 4 | + | |
2 | 5 | | |
3 | 6 | | |
4 | 7 | | |
| |||
15 | 18 | | |
16 | 19 | | |
17 | 20 | | |
18 | | - | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
19 | 24 | | |
20 | 25 | | |
21 | 26 | | |
22 | 27 | | |
23 | 28 | | |
24 | 29 | | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
25 | 36 | | |
26 | 37 | | |
27 | 38 | | |
| |||
68 | 79 | | |
69 | 80 | | |
70 | 81 | | |
| 82 | + | |
71 | 83 | | |
72 | 84 | | |
73 | 85 | | |
74 | 86 | | |
75 | | - | |
| 87 | + | |
76 | 88 | | |
77 | 89 | | |
78 | 90 | | |
| |||
89 | 101 | | |
90 | 102 | | |
91 | 103 | | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
92 | 111 | | |
93 | 112 | | |
94 | 113 | | |
| |||
0 commit comments