joanie
joanie copied to clipboard
Backend code clean-up
Feature Request
Is your feature request related to a problem or unsupported use case? Please describe. Our code has grown fast and could benefit come clean-up
Describe the solution you'd like
- [ ] Remove useless
lookup_field = "pk"
on viewsets - [ ] Rename test methods to be homogeneous and self explanatory from generic to specific
- [ ] Rewrite admin API tests to use a staff user with minimal access rights instead of a superuser.
- [ ] Add admin API tests for an authenticated staff user without the required access rights and make sure they fail
- [ ] Make sure all API tests (admin and client) include read list, read detail, create, update, partial_update and delete, in that order
- [ ] Create a tree structure for test files as there are now too many in the core app.
test_api_admin_contract_definitions.py
will becometests/api/admin/contract_definitions.py
- [ ] Consider renaming serializer fields that only render an id to
*_id
e.g.product_id
instead ofproduct
- [ ] Extract logic from models and implement them in services (See marsha bbb utils)
Please add here anything that you noticed could be improved in the backend code.