def setUp(self):
     self.user = factories.UserFactory()
     self.other_user = factories.UserFactory()
     self.staff_user = factories.UserFactory(is_staff=True, is_active=True)
     self.subdomain = 'fake-subdomain'
     self.session_token = 'fake-session-token'
     self.callback_url = '/services/x/content-online-content-api/v1'
     self.user_guid = "fake-guid"
     self.course_id = 'course-v1:edX+DemoX+DemoCourse'
     self.course_key = 'edX+DemoX'
     self.enterprise_customer = factories.EnterpriseCustomerFactory(
         enable_audit_enrollment=True,
         enable_audit_data_reporting=True,
     )
     self.config = factories.CornerstoneEnterpriseCustomerConfigurationFactory(
         enterprise_customer=self.enterprise_customer,
         active=True,
     )
     self.global_config = factories.CornerstoneGlobalConfigurationFactory(
         key='test_key', secret='test_secret')
     self.enterprise_course_enrollment = self._setup_enterprise_enrollment(
         self.user, self.course_id, self.course_key)
     course_catalog_api_client_mock = mock.patch(
         'enterprise.api_client.discovery.CourseCatalogApiServiceClient')
     course_catalog_client = course_catalog_api_client_mock.start()
     setup_course_catalog_api_client_mock(course_catalog_client)
     self.addCleanup(course_catalog_api_client_mock.stop)
     super(TestCornerstoneLearnerExporter, self).setUp()
Example #2
0
    def setUp(self):
        self.enterprise_customer_catalog = factories.EnterpriseCustomerCatalogFactory()

        # Need a non-abstract config.
        self.config = factories.CornerstoneEnterpriseCustomerConfigurationFactory(
            enterprise_customer=self.enterprise_customer_catalog.enterprise_customer,
        )
        self.global_config = factories.CornerstoneGlobalConfigurationFactory()

        # Mocks
        self.mock_enterprise_customer_catalogs(str(self.enterprise_customer_catalog.uuid))
        jwt_builder = mock.patch('enterprise.api_client.lms.JwtBuilder', mock.Mock())
        self.jwt_builder = jwt_builder.start()
        self.addCleanup(jwt_builder.stop)
        super(TestCornerstoneContentMetadataExporter, self).setUp()