Ejemplo n.º 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
Ejemplo n.º 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'
Ejemplo n.º 3
0
 def test_it_returns_oauth_service(self, pyramid_request):
     svc = services.oauth_service_factory(None, pyramid_request)
     assert isinstance(svc, services.OAuthService)
Ejemplo n.º 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
Ejemplo n.º 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
Ejemplo n.º 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'
Ejemplo n.º 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
Ejemplo n.º 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
Ejemplo n.º 9
0
 def test_it_returns_oauth_service(self, pyramid_request):
     svc = services.oauth_service_factory(None, pyramid_request)
     assert isinstance(svc, services.OAuthService)