Esempio 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
Esempio 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'
Esempio 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)
Esempio 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
Esempio 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
Esempio 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'
Esempio 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
Esempio 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
Esempio 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)