'Context manager for mocking out registration.
Within this context, new users can be registered but they will
be mock objects.  Also all usernames can be registered as the account
lookup is bypassed and Account._by_name always raises NotFound.'

def mock_register(self):

    from r2.controllers import login
    return contextlib.nested(patch.object(login, 'register'), patch.object(VUname, 'run', return_value='test'), patch.object(Account, '_by_name', side_effect=NotFound))
