Refactor tests

Test are refactored to separate functionality and to enable reuse in users of the provider.
Actually this was not intented to be a test. It indicating the that this test helper function must be called with the openid scope. I thought that was going to be more clear using `assert` in its traditional form.

I'll change it.