def test_wraps_email_module_as_signup_email(self, patch, pyramid_request): signup_email = patch('h.emails.signup.generate') svc = user_signup_service_factory(None, pyramid_request) svc.signup_email(id=123, email='*****@*****.**', activation_code='abc456') signup_email.assert_called_once_with(pyramid_request, id=123, email='*****@*****.**', activation_code='abc456')
def test_provides_request_stats_as_stats(self, pyramid_request): svc = user_signup_service_factory(None, pyramid_request) assert svc.stats == pyramid_request.stats
def test_provides_request_db_as_session(self, pyramid_request): svc = user_signup_service_factory(None, pyramid_request) assert svc.session == pyramid_request.db
def test_provides_request_auth_domain_as_default_authority( self, pyramid_request): svc = user_signup_service_factory(None, pyramid_request) assert svc.default_authority == pyramid_request.auth_domain
def test_returns_user_signup_service(self, pyramid_request): svc = user_signup_service_factory(None, pyramid_request) assert isinstance(svc, UserSignupService)
def test_provides_request_auth_domain_as_default_authority(self, pyramid_request): svc = user_signup_service_factory(None, pyramid_request) assert svc.default_authority == pyramid_request.auth_domain