You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Right now, ~70% of chemical_inventory/models.py is covered by unit tests. Let's get this a little bit higher.
Write some tests for some of the simple methods are aren't currently covered. Tests go in chemical_inventory/tests.py. For each test, the basic approach will probably be:
Create a new object for a given model (eg chemical = models.Chemical(name='unobtainium'))
[optional] save the new object to the database (depends on whether the method queries the database)
Call the method from the object and check that the value matches what you expect.s
Here are some simple methods that would be good to start with:
Right now, ~70% of
chemical_inventory/models.py
is covered by unit tests. Let's get this a little bit higher.Write some tests for some of the simple methods are aren't currently covered. Tests go in
chemical_inventory/tests.py
. For each test, the basic approach will probably be:chemical = models.Chemical(name='unobtainium')
)Here are some simple methods that would be good to start with:
Glove.__str__()
Container.is_expired()
Container.quantity_string()
Location.__str__()
StandardOperatingProcedure.__str__()
Chemical.__str__()
Some that might be a little trickier:
Chemical.has_expired()
expired_containers()
Container.mark_as_empty()
To see the test coverage for this file, go here
The text was updated successfully, but these errors were encountered: