Closed miggland closed 2 years ago
@miggland thanks for this addition. It would be great if you can also add some unit tests for new new class functionality. The existing unit tests should be a pretty good demonstration of how to set that up
OK, I have fixed the style issue and added unit tests according to the template
I realised that the delete method was not working - because of a wrong url, caused by an extra / in the URL. This was copied from the line item, so I changed it there also. I also added tests for deleting line items, as well as extra line items
@miggland a couple of things to address here
A simple change needed here, just read through the suggestions in the "style checks" test
It appears that the CI unit testing script was not allowing enough time for the InvenTree server to spin up. This has been fixed in #103 . Please merge master into your branch, and re-push, and the tests should run properly then.
I have tried getting the tests to run locally (using invoke test
in the inventree-python folder) but have not managed - the server does not come up, but fails at "sqlite3.OperationalError: no such table: label_stockitemlabel".
Anyway, I have fixed the style issues and committed those.
I have tried getting the tests to run locally
Did you run the invoke update-image
command before running tests? That should get it all setup and ready to run
Well, at least the unit tests are running now!
Did you run the
invoke update-image
command before running tests? That should get it all setup and ready to run
Yes, now I have. And after installing requirements, I had to install coverage
as well as pillow
because they are not listed in the requirements. The documentation is TESTING.md is a bit lacking here (I'll put a PR for that separately).
New commit coming with fixed tests.
I have copied the relevant functions for PO Line items so that they work for extra line items as well.
These were previously missing from the python API