[change:tests] Added config_app_label in BaseTestNotification#1192
[change:tests] Added config_app_label in BaseTestNotification#1192nemesifier merged 1 commit intoopenwisp:masterfrom
Conversation
WalkthroughA class attribute Estimated code review effort🎯 1 (Trivial) | ⏱️ ~3 minutes 🚥 Pre-merge checks | ✅ 2✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Fix all issues with AI Agents
In @openwisp_controller/connection/tests/test_notifications.py:
- Line 33: In _generic_notification_test, change the reference to the class
attribute config_app_label to use self.config_app_label so device_url_path =
reverse(f"admin:{self.config_app_label}_device_change", args=[self.d.id])
(ensure any other usages in that method also prefix config_app_label with self)
to avoid the NameError when the test runs.
📜 Review details
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
openwisp_controller/connection/tests/test_notifications.py
🧰 Additional context used
🪛 Ruff (0.14.10)
openwisp_controller/connection/tests/test_notifications.py
33-33: Undefined name config_app_label
(F821)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (11)
- GitHub Check: Python==3.10 | django~=5.2.0
- GitHub Check: Python==3.10 | django~=5.1.0
- GitHub Check: Python==3.12 | django~=5.1.0
- GitHub Check: Python==3.13 | django~=5.1.0
- GitHub Check: Python==3.13 | django~=5.2.0
- GitHub Check: Python==3.12 | django~=5.2.0
- GitHub Check: Python==3.11 | django~=5.1.0
- GitHub Check: Python==3.12 | django~=4.2.0
- GitHub Check: Python==3.11 | django~=5.2.0
- GitHub Check: Python==3.10 | django~=4.2.0
- GitHub Check: Python==3.11 | django~=4.2.0
🔇 Additional comments (1)
openwisp_controller/connection/tests/test_notifications.py (1)
20-20: LGTM! Good refactoring to centralize the app label logic.This class attribute provides a single source of truth for the config app label, making the test code more maintainable and easier to extend.
Checklist
Description of Changes
Makes the notifications tests in connection app simpler to extend by exposing the config_app_label at the class level