nicolaiarocci/eve — pull request #399 by hellerstanislav (2014-06-27 10:53:50+00:00)
Title: Fix broken media tests for PUT, PATCH and DELETE.

This PR fixes bug and broken tests: the bug lets previous versions of documents untouched when PUTting or PATCHing some media - they are still stored in the gridfs. This bug was (IMHO) introduced in ad4afe90924241e907e94824b13294bef2c0b217 - calling ``hasattr`` on variable ``original`` (which is type ``dict``) does not work this way. Tests were poorly coded, so they did not discover the failure: checking return value of ``assertMediaField`` (which is tuple, not real ``media_id``) in ``app.media.exists()`` returns always ``False`` (so the tests were useless). Rewritten to ``assertMediaStored``, now working as expected.

Please, let me know, if I'm wrong or if I misunderstood these tests.
Cheers.