'Create a mock file object for testing uploads'

def _mock_file(self, name='file', size=10):

    mock_file = MagicMock(size=size, read=(lambda : ('x' * size)))
    mock_file.name = name
    return mock_file
