Draft
Conversation
This allows to define views available in /admin/selftest/ like an email sender testing view for instance. I'm still not sure about this...
b8f09f9 to
de7adb2
Compare
There was a problem hiding this comment.
Pull Request Overview
This PR introduces a mechanism to register and serve selftest views in the Django admin, allowing the addition of testing views (e.g. an email sender test view) under the /admin/selftest/ URL.
- Introduces a base selftest view (BaseSelftestAdminPageView) and a dedicated index view (IndexSelftestAdminPageView).
- Adds an example email selftest view (EmailSelftestAdminPageView) with GET and POST handlers for sending test emails.
- Implements a registry (ViewRegistry) to automatically discover and register selftest views and extends the admin site URLs accordingly.
Reviewed Changes
Copilot reviewed 3 out of 6 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| src/backend/admin/views.py | Adds base, index, and email selftest views with GET and POST handling. |
| src/backend/admin/sites.py | Extends the admin site URLs to include registered selftest views. |
| src/backend/admin/registry.py | Implements a registry to auto-discover and register custom selftest views. |
Files not reviewed (3)
- src/backend/admin/templates/selftest/base.html: Language not supported
- src/backend/admin/templates/selftest/email.html: Language not supported
- src/backend/admin/templates/selftest/index.html: Language not supported
Comments suppressed due to low confidence (2)
src/backend/admin/registry.py:42
- [nitpick] Consider handling edge cases where the subclass name matches exactly 'SelftestAdminPageView', which may result in an empty name. A more robust naming strategy would prevent potential routing issues.
base_name = name.replace("SelftestAdminPageView", "").lower()
src/backend/admin/views.py:67
- The POST method in EmailSelftestAdminPageView does not have test coverage. Please add tests to ensure the email sending behavior and error handling work as expected.
def post(self, request, *args, **kwargs):
Member
Author
|
Must move this to |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Purpose
This allows to define views available in /admin/selftest/ like an email sender testing view for instance.
I'm still not sure about this...
Proposal