Esempio n. 1
0
    def stub_catalog_api(self, programs):
        """
        Stub the discovery service's program list and detail API endpoints.
        """
        self.set_catalog_integration(is_enabled=True,
                                     service_username=self.username)
        CatalogFixture().install_programs(programs)

        program_types = [program['type'] for program in programs]
        CatalogFixture().install_program_types(program_types)
Esempio n. 2
0
 def stub_catalog_api(self):
     """Stub out the catalog API's course run endpoint."""
     CatalogFixture().install_course_run(self.course_run)
Esempio n. 3
0
 def stub_catalog_api(self, data=None):
     """Stub out the catalog API's program and course run endpoints."""
     self.set_catalog_integration(is_enabled=True,
                                  service_username=self.username)
     CatalogFixture().install_programs(data or self.programs)
 def stub_catalog_api(self):
     """Stub out the catalog API's program endpoint."""
     self.set_catalog_configuration(is_enabled=True)
     CatalogFixture().install_programs([])
Esempio n. 5
0
 def stub_catalog_api(self):
     """Stub out the catalog API's program and course run endpoints."""
     self.set_catalog_configuration(is_enabled=True)
     CatalogFixture().install_programs(self.programs)
     CatalogFixture().install_course_run(self.course_run)