Repository navigation
[tests] Fixed password date assertion at timezone boundaries - #581
Conversation
|
Navigate logical layers of code changes, visualize relationships, and explore their blast radius. 🧰 Additional context used📚 Code guidelines (1)No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configuration
📒 Files selected for processing (1)
Included review availability: This review used your included allowance. Your plan provides up to 2 included reviews per hour; 1 remain after this review. 📜 Recent review details⏰ Context from checks skipped due to timeout. (14)
🧰 Additional context used📓 Path-based instructions (3)Ensure tests cover relevant success, error, boundary, and unusual input scenarios.⚙️ CodeRabbit configuration file Files:
Flag potential security vulnerabilities Flag obvious performance regressions, such as heavy loops, repeated I/O, or unoptimized queries Flag unused or redundant code Flag outdated or incorrect comments/docstrings Ensure new code handles err...⚙️ CodeRabbit configuration file Files:
Source excerpt: Changes to core logic, model validation, migrations, database schema, tenant isolation, authentication, or shared behavior require all affected package and integration suites.📄 CodeRabbit inference engine (AGENTS.md) Files:
🔇 Additional comments (1)
📝 WalkthroughWalkthroughThe password-updated admin display test now freezes time in the Europe/Rome timezone. It expects the rendered date to match Priority: ⬇️ Low Estimated code review effort: 1 (Trivial) | ~2 minutes Change: Other Suggested reviewers: Merge Risk: ⚪ Minimal · up to This change corrects the test’s timezone-boundary expectation without changing production behavior. No merge-blocking risk is identified. 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
Comment |
Checklist
Reference to Existing Issue
Related to #375. Unblocks openwisp/openwisp-controller#1499.
Description of Changes
The password-updated admin test still expected the UTC date from
now(), althoughUser.set_password()correctly records the active local date. This fails when UTC and the configured timezone are on different dates, as seen in Controller's inherited integration test shortly after midnight in Europe/Rome.Used
localdate()in the expected admin output and froze the test at 23:00 UTC with Europe/Rome active, making the boundary regression deterministic. No production code changes.Screenshot
N/A.