Closed atbaker closed 9 years ago
Now we have 100% coverage in tasks :)
Name Stmts Miss Cover
---------------------------
tasks 17 0 100%
96% for everything
Name Stmts Miss Cover
--------------------------------------------------
application 46 1 98%
config/__init__ 0 0 100%
forms/__init__ 0 0 100%
forms/new_appointment 13 0 100%
models/__init__ 0 0 100%
models/appointment 24 1 96%
reminders 6 0 100%
runapp 2 2 0%
tasks 17 0 100%
tests/appointment_test 21 0 100%
tests/base_test 15 0 100%
tests/tasks_test 31 1 97%
views/__init__ 0 0 100%
views/appointment 33 3 91%
--------------------------------------------------
TOTAL 208 8 96%
Is it okay to close this issue now @atbaker?
Yes! I'll close this out.
Right now the test coverage for the app is pretty good - 91% by my measurement:
We don't have a test that covers the task module well, however:
Since this is an important part of the app, we should definitely cover it with at least one test.
The
CELERY_ALWAYS_EAGER
setting is helpful for running tests because it forces Celery to execute tasks synchronously instead of sending them to the message broker:http://docs.celeryproject.org/en/2.5/configuration.html?highlight=celery_always_eager#std:setting-CELERY_ALWAYS_EAGER
I didn't use py.test in my Django unit tests, but my code for testing the Celery task in that app might still be helpful as you write yours:
https://github.com/TwilioDevEd/appointment-reminders-django/blob/master/reminders/tests.py#L89-L112