Beispiel #1
0
 def test_it_provides_user_service(self, pyramid_request, user_service):
     svc = services.oauth_service_factory(None, pyramid_request)
     assert svc.usersvc == user_service
Beispiel #2
0
 def test_it_provides_request_domain(self, pyramid_request):
     pyramid_request.domain = 'example.org'
     svc = services.oauth_service_factory(None, pyramid_request)
     assert svc.domain == 'example.org'
Beispiel #3
0
 def test_it_returns_oauth_service(self, pyramid_request):
     svc = services.oauth_service_factory(None, pyramid_request)
     assert isinstance(svc, services.OAuthService)
Beispiel #4
0
 def test_it_provides_request_db_as_session(self, pyramid_request):
     svc = services.oauth_service_factory(None, pyramid_request)
     assert svc.session == pyramid_request.db
Beispiel #5
0
 def oauth_service(self, pyramid_config, pyramid_request):
     svc = mock.Mock(spec_set=oauth_service_factory(None, pyramid_request))
     svc.verify_jwt_bearer.return_value = (mock.sentinel.user, mock.sentinel.authclient)
     pyramid_config.register_service(svc, name='oauth')
     return svc
Beispiel #6
0
 def test_it_provides_request_domain(self, pyramid_request):
     pyramid_request.domain = 'example.org'
     svc = services.oauth_service_factory(None, pyramid_request)
     assert svc.domain == 'example.org'
Beispiel #7
0
 def test_it_provides_user_service(self, pyramid_request, user_service):
     svc = services.oauth_service_factory(None, pyramid_request)
     assert svc.usersvc == user_service
Beispiel #8
0
 def test_it_provides_request_db_as_session(self, pyramid_request):
     svc = services.oauth_service_factory(None, pyramid_request)
     assert svc.session == pyramid_request.db
Beispiel #9
0
 def test_it_returns_oauth_service(self, pyramid_request):
     svc = services.oauth_service_factory(None, pyramid_request)
     assert isinstance(svc, services.OAuthService)