Exemplo n.º 1
0
 def setUp(self):
     self.api_user = factories.UserFactory(username='******', id=1)
     self.user1 = factories.UserFactory(id=2, email='*****@*****.**')
     self.user2 = factories.UserFactory(id=3, email='*****@*****.**')
     self.course_id = COURSE_ID
     self.enterprise_customer = factories.EnterpriseCustomerFactory(
         name='Spaghetti Enterprise')
     self.identity_provider = FakerFactory.create().slug()  # pylint: disable=no-member
     factories.EnterpriseCustomerIdentityProviderFactory(
         provider_id=self.identity_provider,
         enterprise_customer=self.enterprise_customer,
     )
     self.enterprise_customer_user1 = factories.EnterpriseCustomerUserFactory(
         user_id=self.user1.id,
         enterprise_customer=self.enterprise_customer,
     )
     self.enterprise_customer_user2 = factories.EnterpriseCustomerUserFactory(
         user_id=self.user2.id,
         enterprise_customer=self.enterprise_customer,
     )
     self.enrollment = factories.EnterpriseCourseEnrollmentFactory(
         id=2,
         enterprise_customer_user=self.enterprise_customer_user1,
         course_id=self.course_id,
     )
     self.enrollment = factories.EnterpriseCourseEnrollmentFactory(
         id=3,
         enterprise_customer_user=self.enterprise_customer_user2,
         course_id=self.course_id,
     )
     self.consent1 = factories.DataSharingConsentFactory(
         username=self.user1.username,
         course_id=self.course_id,
         enterprise_customer=self.enterprise_customer,
     )
     self.consent2 = factories.DataSharingConsentFactory(
         username=self.user2.username,
         course_id=self.course_id,
         enterprise_customer=self.enterprise_customer,
     )
     self.degreed = factories.DegreedEnterpriseCustomerConfigurationFactory(
         enterprise_customer=self.enterprise_customer,
         key='key',
         secret='secret',
         degreed_company_id='Degreed Company',
         active=True,
         degreed_base_url='https://www.degreed.com/',
     )
     self.degreed_global_configuration = factories.DegreedGlobalConfigurationFactory(
         oauth_api_path='oauth/token', )
     self.sapsf = factories.SAPSuccessFactorsEnterpriseCustomerConfigurationFactory(
         enterprise_customer=self.enterprise_customer,
         sapsf_base_url='http://enterprise.successfactors.com/',
         key='key',
         secret='secret',
         active=True,
     )
     self.sapsf_global_configuration = factories.SAPSuccessFactorsGlobalConfigurationFactory(
     )
     super(TestTransmitLearnerData, self).setUp()
Exemplo n.º 2
0
 def setUp(self):
     super().setUp()
     self.url_base = "http://betatest.degreed.com/"
     self.oauth_api_path = "oauth/token"
     self.oauth_url = urljoin(self.url_base, self.oauth_api_path)
     self.completion_status_api_path = "api/v1/provider/completion/course"
     self.completion_status_url = urljoin(self.url_base,
                                          self.completion_status_api_path)
     self.course_api_path = "api/v1/provider/content/course"
     self.course_url = urljoin(self.url_base, self.course_api_path)
     self.client_id = "client_id"
     self.client_secret = "client_secret"
     self.company_id = "company_id"
     self.user_id = "user_id"
     self.user_pass = "******"
     self.expires_in = 1800
     self.access_token = "access_token"
     self.expected_token_response_body = {
         "expires_in": self.expires_in,
         "access_token": self.access_token
     }
     factories.DegreedGlobalConfigurationFactory(
         completion_status_api_path=self.completion_status_api_path,
         course_api_path=self.course_api_path,
         oauth_api_path=self.oauth_api_path,
     )
     self.enterprise_config = factories.DegreedEnterpriseCustomerConfigurationFactory(
         key=self.client_id,
         secret=self.client_secret,
         degreed_company_id=self.company_id,
         degreed_base_url=self.url_base,
         degreed_user_id=self.user_id,
         degreed_user_password=self.user_pass,
     )
 def setUp(self):
     self.user = factories.UserFactory(username='******')
     self.enterprise_customer = factories.EnterpriseCustomerFactory(
         catalog=1,
         name='Veridian Dynamics',
     )
     self.degreed = factories.DegreedEnterpriseCustomerConfigurationFactory(
         enterprise_customer=self.enterprise_customer,
         key='key',
         secret='secret',
         degreed_company_id='Degreed Company')
     self.degreed_global_configuration = factories.DegreedGlobalConfigurationFactory(
         degreed_base_url='https://www.degreed.com/', )
     self.sapsf = factories.SAPSuccessFactorsEnterpriseCustomerConfigurationFactory(
         enterprise_customer=self.enterprise_customer,
         sapsf_base_url='http://enterprise.successfactors.com/',
         key='key',
         secret='secret',
         active=True,
     )
     self.sapsf_global_configuration = factories.SAPSuccessFactorsGlobalConfigurationFactory(
     )
     self.catalog_api_config_mock = self._make_patch(
         self._make_catalog_api_location("CatalogIntegration"))
     super(TestTransmitCourseMetadataManagementCommand, self).setUp()