A Basic CRUD Django App using: PostgreSQL Docker Bootstrap
After cloning repo, to Run:
make compose-manage-py cmd="makemigrations"make compose-manage-py cmd="migrate"make buildmake compose-start
Note
JobOffer's andJobTitle's are related and there has to be at least 1JobTitlein order to create aJobOffer.- So after building and starting the app,
run
make compose-manage-py cmd="createsuperuser" - After creating a super user, you can login to
/adminpath and add records intoJobTitletable, which will auto-populate in the create job offer form.
Testing
Only one simple test has been addded into `tests.py` checking the index view;
if no job offers exist, an appropriate message is displayed.
Other tests for following endpoints could include, but are not limited to:
addOffer/
- get request expects form with data fields & status code 200
- posting incomplete/incorrect form data and expecting proper response
(frontend form validation active)
- posting complete/correct form data and expecting proper response
editOffer/<int:job_offer_id>/
- get request with invalid job offer id, expect status code 404 and proper response
- get request with valid job offer id, expect 200 and form pre-populated with offer data
- posting complete data with invalid job offer id, expect status code 404
- posting incomplete/incorrect form data and expecting proper response
(frontend form validation active)
- posting complete/correct form data and expecting proper response
deleteOffer/<int:job_offer_id>/
- get request with invalid job offer id, expect redirect to index and proper response
(Job offer does not exist)
- get request with valid job offer id, expect redirect to index with status code 200
and proper response (Job offer successfully deleted)
Author: Harold Fich
License: MIT