Ejemplo 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)
Ejemplo n.º 2
0
 def stub_catalog_api(self):
     """Stub out the catalog API's course run endpoint."""
     CatalogFixture().install_course_run(self.course_run)
Ejemplo 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)
Ejemplo n.º 4
0
 def stub_catalog_api(self):
     """Stub out the catalog API's program endpoint."""
     self.set_catalog_configuration(is_enabled=True)
     CatalogFixture().install_programs([])
Ejemplo 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)