Esempio n. 1
0
 def set_catalog_integration(self, is_enabled=False, service_username=None):
     """Use this to change the catalog integration config model during tests."""
     ConfigModelFixture('/config/catalog', {
         'enabled': is_enabled,
         'internal_api_url': '{}/api/v1/'.format(CATALOG_STUB_URL),
         'cache_ttl': 0,
         'service_username': service_username,
     }).install()
Esempio n. 2
0
    def populate_course_fixture(self, course_fixture):
        """Populate the children of the test course fixture and upload 49 files."""
        ConfigModelFixture('/config/assets', {'enabled_for_all_courses': True, 'enabled': True}, 'cms').install()
        files = []

        for file_name in os.listdir(UPLOAD_FILE_DIR):
            file_path = 'studio-uploads/' + file_name
            files.append(file_path)
        course_fixture.add_asset(files)
Esempio n. 3
0
 def set_catalog_configuration(self,
                               is_enabled=False,
                               service_url=CATALOG_STUB_URL):
     """Dynamically adjusts the catalog config model during tests."""
     ConfigModelFixture(
         '/config/catalog', {
             'enabled': is_enabled,
             'internal_api_url': '{}/api/v1/'.format(service_url),
             'cache_ttl': 0,
         }).install()
Esempio n. 4
0
 def set_programs_api_configuration(self, is_enabled=False, api_version=1, api_url=PROGRAMS_STUB_URL):
     """Dynamically adjusts the Programs config model during tests."""
     ConfigModelFixture('/config/programs', {
         'enabled': is_enabled,
         'api_version_number': api_version,
         'internal_service_url': api_url,
         'public_service_url': api_url,
         'cache_ttl': 0,
         'enable_student_dashboard': is_enabled,
         'enable_studio_tab': is_enabled,
         'enable_certification': is_enabled,
         'xseries_ad_enabled': is_enabled,
         'program_listing_enabled': is_enabled,
         'program_details_enabled': is_enabled,
     }).install()
 def populate_course_fixture(self, __):
     ConfigModelFixture('/config/self_paced', {'enabled': True}).install()
     # Set the course start date to tomorrow in order to allow setting pacing
     self.course_fixture.add_course_details(
         {'start_date': datetime.now() + timedelta(days=1)})
Esempio n. 6
0
 def enable_forums(self, is_enabled=True):
     """Configures whether or not forums are enabled."""
     ConfigModelFixture('/config/forums', {
         'enabled': is_enabled,
     }).install()
Esempio n. 7
0
 def set_programs_api_configuration(self, is_enabled=False):
     """Dynamically adjusts the Programs config model during tests."""
     ConfigModelFixture('/config/programs', {
         'enabled': is_enabled,
         'marketing_path': '/foo',
     }).install()
Esempio n. 8
0
 def populate_course_fixture(self, course_fixture):
     """Populate the children of the test course fixture."""
     ConfigModelFixture('/config/assets', {'enabled_for_all_courses': True, 'enabled': True}, 'cms').install()
     self.course_fixture.add_asset(['image.jpg', 'textbook.pdf'])