Fix tests for Py32 and PyPy3

The mock library became a part of standard unittest library since
Python 3.3. So we need to use a mock from PyPI for older interpreter
versions.