Refactor test_invite

This changed on production also