Closed lingxiaoyang closed 10 years ago
Yes I actually was aware that this would be a problem. I think the best way to go about this would be to write the test class as an APITestCase
, and make the REST calls to upload resources in a setUp()
method. Then the tasks would be run on only those resources that had just been uploaded, instead of from the fixtures.
Anyway I will work on fixing this in the next few days.
@lingxiaoyang did your Model Mommy solution fix this issue?
@rberkow Model Mommy creates model objects in setUp()
method, and then the tests rely on these dynamically generated objects instead of fixtures. It makes easier to manipulate the test objects.
@rberkow GameraTask test
test_to_greyscale
throws aSuspiciousFileOperation
exception because it cannot find the specific image file on your machine with the file path coming from fixtures. Is there a better way to test the functionality of tasks?The error message from
python manage.py test
: