Use cache directory from context for tests
Merge pull request #634 from hssm/mediatests2

Use cache directory from context for tests