Refactor package view test base
Make sure that call to PyPI is mocked.
Test when refresh fails
I.e. PyPI is down.