We have created a mini application with:
- A
Volumemodel - A JavaScript function
formatHumanReadable - A
HumanReadableWidgetthat uses theformatHumanReadablefunction
You are asked to:
-
Create a file
/tests/test_volume.py- This file should test the Python model
- Create records and verify that
.volumeand.categoryreturn the expected values
-
Create a file
/static/tests/human_readable.test.js- This file should test the
formatHumanReadablefunction - It should also test the
HumanReadableWidget
- This file should test the
-
Add an integration test in
/tests/test_volume.py- Create a test that inserts records into the database
- Verify that the records have been correctly added and that the data is correct
- You will need to create a file
/static/tests/tours/create_volume.jsto write the tour in it
./odoo-bin --config=../.vscode/odoo.conf -i smartclass./odoo-bin --config=../.vscode/odoo.conf --test-enable --test-tags=.test_volume_modelRun the Odoo server for JS tests:
./odoo-bin --config=../.vscode/odoo.confThen, open your browser and navigate to:
http://localhost:8069/web/tests?debug=assets
./odoo-bin --config=../.vscode/odoo.conf --test-enable --test-tags=.test_tour_create_volumesYou can add debug=1 to the start_tour method to run the tour in debug mode.