def setUp(self): super(ConfigurationModelAPITests, self).setUp() self.factory = APIRequestFactory() self.user = User.objects.create_user( username='******', email='*****@*****.**', password='******', ) self.user.is_superuser = True self.user.save() self.current_view = ConfigurationModelCurrentAPIView.as_view( model=ExampleConfig)
def setUp(self): super(ConfigurationModelAPITests, self).setUp() self.factory = APIRequestFactory() self.user = User.objects.create_user( username='******', email='*****@*****.**', password='******', ) self.user.is_superuser = True self.user.save() self.current_view = ConfigurationModelCurrentAPIView.as_view(model=ExampleConfig) # Disable caching while testing the API patcher = patch('config_models.models.cache', Mock(get=Mock(return_value=None))) patcher.start() self.addCleanup(patcher.stop)
urlpatterns += [ url(r'^courses/{}/'.format(settings.COURSE_ID_PATTERN), include('ccx.urls')), url(r'^api/ccx/', include('lms.djangoapps.ccx.api.urls', namespace='ccx_api')), ] # Access to courseware as an LTI provider if settings.FEATURES.get('ENABLE_LTI_PROVIDER'): urlpatterns += [ url(r'^lti_provider/', include('lti_provider.urls')), ] urlpatterns += [ url(r'config/self_paced', ConfigurationModelCurrentAPIView.as_view( model=SelfPacedConfiguration)), url(r'config/programs', ConfigurationModelCurrentAPIView.as_view(model=ProgramsApiConfig)), url(r'config/catalog', ConfigurationModelCurrentAPIView.as_view(model=CatalogIntegration)), url(r'config/forums', ConfigurationModelCurrentAPIView.as_view(model=ForumsConfig)), ] if settings.DEBUG: urlpatterns += static(settings.STATIC_URL, document_root=settings.STATIC_ROOT) urlpatterns += static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT) urlpatterns += static( settings.PROFILE_IMAGE_BACKEND['options']['base_url'],
# Custom courses on edX (CCX) URLs if settings.FEATURES['CUSTOM_COURSES_EDX']: urlpatterns += [ url(r'^courses/{}/'.format(settings.COURSE_ID_PATTERN), include('ccx.urls')), url(r'^api/ccx/', include('lms.djangoapps.ccx.api.urls', namespace='ccx_api')), ] # Access to courseware as an LTI provider if settings.FEATURES.get('ENABLE_LTI_PROVIDER'): urlpatterns += [ url(r'^lti_provider/', include('lti_provider.urls')), ] urlpatterns += [ url(r'config/self_paced', ConfigurationModelCurrentAPIView.as_view(model=SelfPacedConfiguration)), url(r'config/programs', ConfigurationModelCurrentAPIView.as_view(model=ProgramsApiConfig)), url(r'config/catalog', ConfigurationModelCurrentAPIView.as_view(model=CatalogIntegration)), url(r'config/forums', ConfigurationModelCurrentAPIView.as_view(model=ForumsConfig)), ] if settings.DEBUG: urlpatterns += static(settings.STATIC_URL, document_root=settings.STATIC_ROOT) urlpatterns += static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT) urlpatterns += static( settings.PROFILE_IMAGE_BACKEND['options']['base_url'], document_root=settings.PROFILE_IMAGE_BACKEND['options']['location'] ) # UX reference templates urlpatterns += [
document_root=settings.VIDEO_TRANSCRIPTS_SETTINGS['STORAGE_KWARGS'] ['location']) if 'debug_toolbar' in settings.INSTALLED_APPS: import debug_toolbar urlpatterns.append(url(r'^__debug__/', include(debug_toolbar.urls))) # UX reference templates urlpatterns.append( url(r'^template/(?P<template>.+)$', openedx.core.djangoapps.debug.views.show_reference_template, name='openedx.core.djangoapps.debug.views.show_reference_template')) urlpatterns += [ url(r'config/assets', ConfigurationModelCurrentAPIView.as_view(model=NewAssetsPageFlag)), ] # Custom error pages # These are used by Django to render these error codes. Do not remove. # pylint: disable=invalid-name handler404 = contentstore.views.render_404 handler500 = contentstore.views.render_500 # display error page templates, for testing purposes urlpatterns += [ url(r'^404$', handler404), url(r'^500$', handler500), ] from openedx.core.djangoapps.plugins import constants as plugin_constants, plugin_urls
# Custom courses on edX (CCX) URLs if settings.FEATURES["CUSTOM_COURSES_EDX"]: urlpatterns += ( url(r'^courses/{}/'.format(settings.COURSE_ID_PATTERN), include('ccx.urls')), ) # Access to courseware as an LTI provider if settings.FEATURES.get("ENABLE_LTI_PROVIDER"): urlpatterns += ( url(r'^lti_provider/', include('lti_provider.urls')), ) urlpatterns += ( url(r'config/self_paced', ConfigurationModelCurrentAPIView.as_view(model=SelfPacedConfiguration)), url(r'config/programs', ConfigurationModelCurrentAPIView.as_view(model=ProgramsApiConfig)), ) urlpatterns = patterns(*urlpatterns) if settings.DEBUG: urlpatterns += static(settings.STATIC_URL, document_root=settings.STATIC_ROOT) urlpatterns += static( settings.PROFILE_IMAGE_BACKEND['options']['base_url'], document_root=settings.PROFILE_IMAGE_BACKEND['options']['location'] ) # in debug mode, allow any template to be rendered (most useful for UX reference templates) urlpatterns += url(r'^template/(?P<template>.+)$', 'debug.views.show_reference_template'),
urlpatterns += ( url(r'^affiliates/', include('lms.djangoapps.affiliates.urls', namespace='affiliates')), url( r'^api/affiliates/', include('lms.djangoapps.affiliates.api.urls', namespace='affiliates_api')), ) # Access to courseware as an LTI provider if settings.FEATURES.get("ENABLE_LTI_PROVIDER"): urlpatterns += (url(r'^lti_provider/', include('lti_provider.urls')), ) urlpatterns += ( url(r'config/self_paced', ConfigurationModelCurrentAPIView.as_view( model=SelfPacedConfiguration)), url(r'config/programs', ConfigurationModelCurrentAPIView.as_view(model=ProgramsApiConfig)), ) urlpatterns = patterns(*urlpatterns) if settings.DEBUG: urlpatterns += static(settings.STATIC_URL, document_root=settings.STATIC_ROOT) urlpatterns += static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT) urlpatterns += static( settings.PROFILE_IMAGE_BACKEND['options']['base_url'], document_root=settings.PROFILE_IMAGE_BACKEND['options']['location'])
url(r"^update_example_certificate$", "certificates.views.update_example_certificate"), url(r"^request_certificate$", "certificates.views.request_certificate"), ) # XDomain proxy urlpatterns += (url(r"^xdomain_proxy.html$", "cors_csrf.views.xdomain_proxy", name="xdomain_proxy"),) # Custom courses on edX (CCX) URLs if settings.FEATURES["CUSTOM_COURSES_EDX"]: urlpatterns += (url(r"^courses/{}/".format(settings.COURSE_ID_PATTERN), include("ccx.urls")),) # Access to courseware as an LTI provider if settings.FEATURES.get("ENABLE_LTI_PROVIDER"): urlpatterns += (url(r"^lti_provider/", include("lti_provider.urls")),) urlpatterns += (url(r"config/self_paced", ConfigurationModelCurrentAPIView.as_view(model=SelfPacedConfiguration)),) urlpatterns = patterns(*urlpatterns) if settings.DEBUG: urlpatterns += static(settings.STATIC_URL, document_root=settings.STATIC_ROOT) urlpatterns += static( settings.PROFILE_IMAGE_BACKEND["options"]["base_url"], document_root=settings.PROFILE_IMAGE_BACKEND["options"]["location"], ) # in debug mode, allow any template to be rendered (most useful for UX reference templates) urlpatterns += (url(r"^template/(?P<template>.+)$", "debug.views.show_reference_template"),) if "debug_toolbar" in settings.INSTALLED_APPS: import debug_toolbar
# Custom courses on edX (CCX) URLs if settings.FEATURES["CUSTOM_COURSES_EDX"]: urlpatterns += ( url(r'^courses/{}/'.format(settings.COURSE_ID_PATTERN), include('ccx.urls')), url(r'^api/ccx/', include('lms.djangoapps.ccx.api.urls', namespace='ccx_api')), ) # Access to courseware as an LTI provider if settings.FEATURES.get("ENABLE_LTI_PROVIDER"): urlpatterns += ( url(r'^lti_provider/', include('lti_provider.urls')), ) urlpatterns += ( url(r'config/self_paced', ConfigurationModelCurrentAPIView.as_view(model=SelfPacedConfiguration)), url(r'config/programs', ConfigurationModelCurrentAPIView.as_view(model=ProgramsApiConfig)), url(r'config/catalog', ConfigurationModelCurrentAPIView.as_view(model=CatalogIntegration)), url(r'config/forums', ConfigurationModelCurrentAPIView.as_view(model=ForumsConfig)), ) urlpatterns = patterns(*urlpatterns) if settings.DEBUG: urlpatterns += static(settings.STATIC_URL, document_root=settings.STATIC_ROOT) urlpatterns += static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT) urlpatterns += static( settings.PROFILE_IMAGE_BACKEND['options']['base_url'], document_root=settings.PROFILE_IMAGE_BACKEND['options']['location'] )
# Custom courses on edX (CCX) URLs if settings.FEATURES["CUSTOM_COURSES_EDX"]: urlpatterns += ( url(r'^courses/{}/'.format(settings.COURSE_ID_PATTERN), include('ccx.urls')), ) # Access to courseware as an LTI provider if settings.FEATURES.get("ENABLE_LTI_PROVIDER"): urlpatterns += ( url(r'^lti_provider/', include('lti_provider.urls')), ) urlpatterns += ( url(r'config/self_paced', ConfigurationModelCurrentAPIView.as_view(model=SelfPacedConfiguration)), ) urlpatterns = patterns(*urlpatterns) if settings.DEBUG: urlpatterns += static(settings.STATIC_URL, document_root=settings.STATIC_ROOT) urlpatterns += static( settings.PROFILE_IMAGE_BACKEND['options']['base_url'], document_root=settings.PROFILE_IMAGE_BACKEND['options']['location'] ) # in debug mode, allow any template to be rendered (most useful for UX reference templates) urlpatterns += url(r'^template/(?P<template>.+)$', 'debug.views.show_reference_template'), if 'debug_toolbar' in settings.INSTALLED_APPS:
urlpatterns += (url(r'^xdomain_proxy.html$', 'cors_csrf.views.xdomain_proxy', name='xdomain_proxy'), ) # Custom courses on edX (CCX) URLs if settings.FEATURES["CUSTOM_COURSES_EDX"]: urlpatterns += (url(r'^courses/{}/'.format(settings.COURSE_ID_PATTERN), include('ccx.urls')), ) # Access to courseware as an LTI provider if settings.FEATURES.get("ENABLE_LTI_PROVIDER"): urlpatterns += (url(r'^lti_provider/', include('lti_provider.urls')), ) urlpatterns += (url( r'config/self_paced', ConfigurationModelCurrentAPIView.as_view(model=SelfPacedConfiguration)), ) urlpatterns = patterns(*urlpatterns) if settings.DEBUG: urlpatterns += static(settings.STATIC_URL, document_root=settings.STATIC_ROOT) urlpatterns += static( settings.PROFILE_IMAGE_BACKEND['options']['base_url'], document_root=settings.PROFILE_IMAGE_BACKEND['options']['location']) # in debug mode, allow any template to be rendered (most useful for UX reference templates) urlpatterns += url(r'^template/(?P<template>.+)$', 'debug.views.show_reference_template'), if 'debug_toolbar' in settings.INSTALLED_APPS:
# XDomain proxy urlpatterns += (url(r"^xdomain_proxy.html$", "cors_csrf.views.xdomain_proxy", name="xdomain_proxy"),) # Custom courses on edX (CCX) URLs if settings.FEATURES["CUSTOM_COURSES_EDX"]: urlpatterns += ( url(r"^courses/{}/".format(settings.COURSE_ID_PATTERN), include("ccx.urls")), url(r"^api/ccx/", include("lms.djangoapps.ccx.api.urls", namespace="ccx_api")), ) # Access to courseware as an LTI provider if settings.FEATURES.get("ENABLE_LTI_PROVIDER"): urlpatterns += (url(r"^lti_provider/", include("lti_provider.urls")),) urlpatterns += ( url(r"config/self_paced", ConfigurationModelCurrentAPIView.as_view(model=SelfPacedConfiguration)), url(r"config/programs", ConfigurationModelCurrentAPIView.as_view(model=ProgramsApiConfig)), url(r"config/catalog", ConfigurationModelCurrentAPIView.as_view(model=CatalogIntegration)), ) urlpatterns = patterns(*urlpatterns) if settings.DEBUG: urlpatterns += static(settings.STATIC_URL, document_root=settings.STATIC_ROOT) urlpatterns += static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT) urlpatterns += static( settings.PROFILE_IMAGE_BACKEND["options"]["base_url"], document_root=settings.PROFILE_IMAGE_BACKEND["options"]["location"], ) urlpatterns += (url(r"^template/(?P<template>.+)$", "openedx.core.djangoapps.debug.views.show_reference_template"),)