Ejemplo n.º 1
0
    def setUp(self):
        super(CertificateExceptionViewInstructorApiTest, self).setUp()
        self.global_staff = GlobalStaffFactory()
        self.instructor = InstructorFactory(course_key=self.course.id)
        self.user = UserFactory()
        self.user2 = UserFactory()
        CourseEnrollment.enroll(self.user, self.course.id)
        CourseEnrollment.enroll(self.user2, self.course.id)
        self.url = reverse('certificate_exception_view', kwargs={'course_id': unicode(self.course.id)})

        certificate_white_list_item = CertificateWhitelistFactory.create(
            user=self.user2,
            course_id=self.course.id,
        )

        self.certificate_exception = dict(
            created="",
            notes="Test Notes for Test Certificate Exception",
            user_email='',
            user_id='',
            user_name=unicode(self.user.username)
        )

        self.certificate_exception_in_db = dict(
            id=certificate_white_list_item.id,
            user_name=certificate_white_list_item.user.username,
            notes=certificate_white_list_item.notes,
            user_email=certificate_white_list_item.user.email,
            user_id=certificate_white_list_item.user.id,
        )

        # Enable certificate generation
        cache.clear()
        CertificateGenerationConfiguration.objects.create(enabled=True)
        self.client.login(username=self.global_staff.username, password='******')
Ejemplo n.º 2
0
 def _enable_xblock_disable_config(self, enabled):
     """ Enable or disable xblocks disable. """
     config = XBlockDisableConfig.current()
     config.enabled = enabled
     config.disabled_blocks = "\n".join(('combinedopenended', 'peergrading'))
     config.save()
     cache.clear()
Ejemplo n.º 3
0
    def setUp(self):
        super(CertificatesInstructorApiTest, self).setUp()
        self.global_staff = GlobalStaffFactory()
        self.instructor = InstructorFactory(course_key=self.course.id)

        # Enable certificate generation
        cache.clear()
        CertificateGenerationConfiguration.objects.create(enabled=True)
Ejemplo n.º 4
0
    def test_visible_only_when_feature_flag_enabled(self):
        # Disable the feature flag
        CertificateGenerationConfiguration.objects.create(enabled=False)
        cache.clear()

        # Now even global staff can't see the certificates section
        self.client.login(username=self.global_staff.username, password="******")
        self._assert_certificates_visible(False)
Ejemplo n.º 5
0
 def setUp(self):
     super(DashboardTestsWithSiteOverrides, self).setUp()
     self.org = 'fakeX'
     self.course = CourseFactory.create(org=self.org)
     self.user = UserFactory.create(username='******', email='*****@*****.**', password='******')
     CourseModeFactory.create(mode_slug='no-id-professional', course_id=self.course.id)
     CourseEnrollment.enroll(self.user, self.course.location.course_key, mode='no-id-professional')
     cache.clear()
Ejemplo n.º 6
0
 def setUp(self):
     super(DashboardTestsWithSiteOverrides, self).setUp()
     self.org = "fakeX"
     self.course = CourseFactory.create(org=self.org)
     self.user = UserFactory.create(username="******", email="*****@*****.**", password="******")
     CourseModeFactory.create(mode_slug="no-id-professional", course_id=self.course.id)
     CourseEnrollment.enroll(self.user, self.course.location.course_key, mode="no-id-professional")
     cache.clear()
Ejemplo n.º 7
0
    def setUp(self):
        """Clear model-based config cache. """
        super(XDomainProxyTest, self).setUp()
        try:
            self.url = reverse('xdomain_proxy')
        except NoReverseMatch:
            self.skipTest('xdomain_proxy URL is not configured')

        cache.clear()
Ejemplo n.º 8
0
    def setUp(self):
        super(CertificatesInstructorDashTest, self).setUp()
        self.global_staff = GlobalStaffFactory()
        self.instructor = InstructorFactory(course_key=self.course.id)

        # Need to clear the cache for model-based configuration
        cache.clear()

        # Enable the certificate generation feature
        CertificateGenerationConfiguration.objects.create(enabled=True)
Ejemplo n.º 9
0
    def _configure(self, is_enabled, whitelist=None):
        """Enable or disable the end-point and configure the whitelist. """
        config = XDomainProxyConfiguration.current()
        config.enabled = is_enabled

        if whitelist:
            config.whitelist = "\n".join(whitelist)

        config.save()
        cache.clear()
Ejemplo n.º 10
0
    def setUp(self):
        super(CertificatesInstructorDashTest, self).setUp()
        self.course = CourseFactory.create()
        self.url = reverse("instructor_dashboard", kwargs={"course_id": unicode(self.course.id)})
        self.global_staff = GlobalStaffFactory()
        self.instructor = InstructorFactory(course_key=self.course.id)

        # Need to clear the cache for model-based configuration
        cache.clear()

        # Enable the certificate generation feature
        CertificateGenerationConfiguration.objects.create(enabled=True)
Ejemplo n.º 11
0
    def setUp(self):
        super(EmbargoMiddlewareAccessTests, self).setUp("embargo")
        self.user = UserFactory(username=self.USERNAME, password=self.PASSWORD)
        self.course = CourseFactory.create()
        self.client.login(username=self.USERNAME, password=self.PASSWORD)

        self.courseware_url = reverse("course_root", kwargs={"course_id": unicode(self.course.id)})
        self.non_courseware_url = reverse("dashboard")

        # Clear the cache to avoid interference between tests
        django_cache.clear()
        config_cache.clear()
Ejemplo n.º 12
0
 def setUp(self):
     super(DashboardTestsWithSiteOverrides, self).setUp()
     self.org = 'fakeX'
     self.course = CourseFactory.create(org=self.org)
     self.user = UserFactory.create(username='******',
                                    email='*****@*****.**',
                                    password='******')
     CourseModeFactory.create(mode_slug='no-id-professional',
                              course_id=self.course.id)
     CourseEnrollment.enroll(self.user,
                             self.course.location.course_key,
                             mode='no-id-professional')
     cache.clear()
Ejemplo n.º 13
0
    def setUp(self):
        super(CertificatesInstructorDashTest, self).setUp()
        self.course = CourseFactory.create()
        self.url = reverse('instructor_dashboard',
                           kwargs={'course_id': unicode(self.course.id)})
        self.global_staff = GlobalStaffFactory()
        self.instructor = InstructorFactory(course_key=self.course.id)

        # Need to clear the cache for model-based configuration
        cache.clear()

        # Enable the certificate generation feature
        CertificateGenerationConfiguration.objects.create(enabled=True)
Ejemplo n.º 14
0
    def setUp(self):
        super(EmbargoMiddlewareAccessTests, self).setUp('embargo')
        self.user = UserFactory(username=self.USERNAME, password=self.PASSWORD)
        self.course = CourseFactory.create()
        self.client.login(username=self.USERNAME, password=self.PASSWORD)

        self.courseware_url = reverse(
            'course_root', kwargs={'course_id': unicode(self.course.id)})
        self.non_courseware_url = reverse('dashboard')

        # Clear the cache to avoid interference between tests
        django_cache.clear()
        config_cache.clear()
Ejemplo n.º 15
0
    def setUp(self):
        super().setUp()
        self.user = UserFactory(username=self.USERNAME, password=self.PASSWORD)
        self.course = CourseFactory.create()
        self.client.login(username=self.USERNAME, password=self.PASSWORD)

        self.courseware_url = reverse(
            'about_course', kwargs={'course_id': str(self.course.id)})
        self.non_courseware_url = reverse('dashboard')

        # Clear the cache to avoid interference between tests
        django_cache.clear()
        config_cache.clear()
Ejemplo n.º 16
0
    def setUp(self):
        super(EmbargoMiddlewareAccessTests, self).setUp()  # lint-amnesty, pylint: disable=super-with-arguments
        self.user = UserFactory(username=self.USERNAME, password=self.PASSWORD)
        self.course = CourseFactory.create()
        self.client.login(username=self.USERNAME, password=self.PASSWORD)

        self.courseware_url = reverse(
            'openedx.course_experience.course_home',
            kwargs={'course_id': six.text_type(self.course.id)})
        self.non_courseware_url = reverse('dashboard')

        # Clear the cache to avoid interference between tests
        django_cache.clear()
        config_cache.clear()
Ejemplo n.º 17
0
    def setUp(self):
        """ Setup components used by each refund test."""
        super(RefundableTest, self).setUp()
        self.user = UserFactory.create(username="******", email="*****@*****.**", password='******')
        self.verified_mode = CourseModeFactory.create(
            course_id=self.course.id,
            mode_slug='verified',
            mode_display_name='Verified',
            expiration_datetime=datetime.now(pytz.UTC) + timedelta(days=1)
        )
        self.enrollment = CourseEnrollment.enroll(self.user, self.course.id, mode='verified')

        self.client = Client()
        cache.clear()
Ejemplo n.º 18
0
    def setUp(self):
        """ Setup components used by each refund test."""
        super().setUp()
        self.user = UserFactory.create(password=self.USER_PASSWORD)
        self.verified_mode = CourseModeFactory.create(
            course_id=self.course.id,
            mode_slug='verified',
            mode_display_name='Verified',
            expiration_datetime=datetime.now(pytz.UTC) + timedelta(days=1)
        )

        self.enrollment = CourseEnrollment.enroll(self.user, self.course.id, mode='verified')

        self.client = Client()
        cache.clear()
Ejemplo n.º 19
0
    def setUp(self):
        super(CertificatesInstructorApiTest, self).setUp()
        self.global_staff = GlobalStaffFactory()
        self.instructor = InstructorFactory(course_key=self.course.id)
        self.user = UserFactory()

        # Enable certificate generation
        self.certificate_exception_data = [
            dict(created="Wednesday, October 28, 2015",
                 notes="Test Notes for Test Certificate Exception",
                 user_email='',
                 user_id='',
                 user_name=unicode(self.user.username)),
        ]

        cache.clear()
        CertificateGenerationConfiguration.objects.create(enabled=True)
Ejemplo n.º 20
0
    def test_linked_in_url_not_exists_without_config(self):
        user = Mock(username="******")
        survey_url = "http://a_survey.com"
        course = Mock(display_name="Demo Course",
                      end_of_course_survey_url=survey_url,
                      certificates_display_behavior='end')

        download_url = 'http://s3.edx/cert'
        cert_status = {
            'status': 'downloadable',
            'grade': '67',
            'download_url': download_url,
            'mode': 'verified'
        }

        self.assertEqual(
            _cert_info(user, course, cert_status, 'verified'), {
                'status': 'ready',
                'show_disabled_download_button': False,
                'show_download_url': True,
                'download_url': download_url,
                'show_survey_button': True,
                'survey_url': survey_url,
                'grade': '67',
                'mode': 'verified',
                'linked_in_url': None
            })

        # Enabling the configuration will cause the LinkedIn
        # "add to profile" button to appear.
        # We need to clear the cache again to make sure we
        # pick up the modified configuration.
        cache.clear()
        LinkedInAddToProfileConfiguration(
            company_identifier='0_mC_o2MizqdtZEmkVXjH4eYwMj4DnkCWrZP_D9',
            enabled=True).save()

        status_dict = _cert_info(user, course, cert_status, 'honor')
        expected_url = (
            'http://www.linkedin.com/profile/add'
            '?_ed=0_mC_o2MizqdtZEmkVXjH4eYwMj4DnkCWrZP_D9&'
            'pfCertificationName=edX+Verified+Certificate+for+Demo+Course&'
            'pfCertificationUrl=http%3A%2F%2Fs3.edx%2Fcert&'
            'source=o')
        self.assertEqual(expected_url, status_dict['linked_in_url'])
Ejemplo n.º 21
0
    def setUp(self):
        super(DashboardTestXSeriesPrograms, self).setUp()

        self.user = UserFactory.create(username="******", email="*****@*****.**", password='******')
        self.course_1 = CourseFactory.create()
        self.course_2 = CourseFactory.create()
        self.course_3 = CourseFactory.create()
        self.program_name = 'Testing Program'
        self.category = 'xseries'

        CourseModeFactory.create(
            course_id=self.course_1.id,
            mode_slug='verified',
            mode_display_name='Verified',
            expiration_datetime=datetime.now(pytz.UTC) + timedelta(days=1)
        )
        self.client = Client()
        cache.clear()
Ejemplo n.º 22
0
    def setUp(self):
        super(DashboardTestXSeriesPrograms, self).setUp()

        self.user = UserFactory.create(username="******", email="*****@*****.**", password='******')
        self.course_1 = CourseFactory.create()
        self.course_2 = CourseFactory.create()
        self.course_3 = CourseFactory.create()
        self.program_name = 'Testing Program'
        self.category = 'xseries'

        CourseModeFactory.create(
            course_id=self.course_1.id,
            mode_slug='verified',
            mode_display_name='Verified',
            expiration_datetime=datetime.now(pytz.UTC) + timedelta(days=1)
        )
        self.client = Client()
        cache.clear()
    def setUp(self):
        super(CertificatesInstructorApiTest, self).setUp()
        self.global_staff = GlobalStaffFactory()
        self.instructor = InstructorFactory(course_key=self.course.id)
        self.user = UserFactory()

        # Enable certificate generation
        self.certificate_exception_data = [
            dict(
                created="Wednesday, October 28, 2015",
                notes="Test Notes for Test Certificate Exception",
                user_email="",
                user_id="",
                user_name=unicode(self.user.username),
            )
        ]

        cache.clear()
        CertificateGenerationConfiguration.objects.create(enabled=True)
Ejemplo n.º 24
0
    def setUp(self):
        super(GenerateCertificatesInstructorApiTest, self).setUp()
        self.global_staff = GlobalStaffFactory()
        self.instructor = InstructorFactory(course_key=self.course.id)
        self.user = UserFactory()
        CourseEnrollment.enroll(self.user, self.course.id)
        certificate_exception = CertificateWhitelistFactory.create(
            user=self.user,
            course_id=self.course.id,
        )

        self.certificate_exception = dict(
            id=certificate_exception.id,
            user_name=certificate_exception.user.username,
            notes=certificate_exception.notes,
            user_email=certificate_exception.user.email,
            user_id=certificate_exception.user.id,
        )

        # Enable certificate generation
        cache.clear()
        CertificateGenerationConfiguration.objects.create(enabled=True)
        self.client.login(username=self.global_staff.username, password='******')
Ejemplo n.º 25
0
 def tearDown(self):
     super(IPFilterFormTest, self).tearDown()
     # Explicitly clear ConfigurationModel's cache so tests have a clear cache
     # and don't interfere with each other
     cache.clear()
Ejemplo n.º 26
0
 def tearDown(self):
     # Explicitly clear ConfigurationModel's cache so tests have a clear cache
     # and don't interfere with each other
     cache.clear()
Ejemplo n.º 27
0
 def setUp(self):
     # Explicitly clear the cache, since ConfigurationModel relies on the cache
     cache.clear()
Ejemplo n.º 28
0
    def setUp(self):  # pylint: disable=arguments-differ
        super(CertificateGenerationEnabledTest, self).setUp('certificates.api.tracker')

        # Since model-based configuration is cached, we need
        # to clear the cache before each test.
        cache.clear()
Ejemplo n.º 29
0
    def setUp(self):  # pylint: disable=arguments-differ
        super().setUp('lms.djangoapps.certificates.api.tracker')

        # Since model-based configuration is cached, we need
        # to clear the cache before each test.
        cache.clear()
Ejemplo n.º 30
0
 def setUp(self):
     super(DashboardTest, self).setUp()  # lint-amnesty, pylint: disable=super-with-arguments
     self.course = CourseFactory.create()
     self.user = UserFactory.create(username="******", email="*****@*****.**", password='******')
     self.client = Client()
     cache.clear()
Ejemplo n.º 31
0
 def setUp(self):
     """Clear the configuration cache. """
     super(TestFooter, self).setUp()
     cache.clear()
Ejemplo n.º 32
0
 def tearDown(self):
     super(IPFilterFormTest, self).tearDown()  # lint-amnesty, pylint: disable=super-with-arguments
     # Explicitly clear ConfigurationModel's cache so tests have a clear cache
     # and don't interfere with each other
     cache.clear()
Ejemplo n.º 33
0
    def setUp(self):  # pylint: disable=arguments-differ
        super(CertificateGenerationEnabledTest, self).setUp('certificates.api.tracker')

        # Since model-based configuration is cached, we need
        # to clear the cache before each test.
        cache.clear()
Ejemplo n.º 34
0
 def setUp(self):
     super(DashboardTest, self).setUp()
     self.course = CourseFactory.create()
     self.user = UserFactory.create(username="******", email="*****@*****.**", password='******')
     self.client = Client()
     cache.clear()
Ejemplo n.º 35
0
 def setUp(self):
     """Clear the configuration cache. """
     super(TestFooter, self).setUp()
     cache.clear()
Ejemplo n.º 36
0
 def tearDown(self):
     # Explicitly clear ConfigurationModel's cache so tests have a clear cache
     # and don't interfere with each other
     cache.clear()
     self.patcher.stop()
Ejemplo n.º 37
0
 def setUp(self):
     # Explicitly clear the cache, since ConfigurationModel relies on the cache
     cache.clear()
Ejemplo n.º 38
0
    def setUp(self):
        super(CourseEndingTest, self).setUp()

        # Clear the model-based config cache to avoid
        # interference between tests.
        cache.clear()
Ejemplo n.º 39
0
    def setUp(self, **kwargs):  # pylint: disable=unused-argument
        super(TestGetXSeriesPrograms, self).setUp()
        self.create_config(enabled=True, enable_student_dashboard=True)
        Client.objects.get_or_create(name="programs", client_type=CONFIDENTIAL)
        self.user = UserFactory()
        cache.clear()
        self.programs_api_response = {
            "results": [
                {
                    'category': 'xseries',
                    'status': 'active',
                    'subtitle': 'Dummy program 1 for testing',
                    'name': 'First Program',
                    'organization': {'display_name': 'Test Organization 1', 'key': 'edX'},
                    'course_codes': [
                        {
                            'organization': {'display_name': 'Test Organization 1', 'key': 'edX'},
                            'display_name': 'Demo XSeries Program 1',
                            'key': 'TEST_A',
                            'run_modes': [
                                {'sku': '', 'mode_slug': 'ABC_1', 'course_key': 'edX/DemoX_1/Run_1'},
                                {'sku': '', 'mode_slug': 'ABC_2', 'course_key': 'edX/DemoX_2/Run_2'},
                            ]
                        }
                    ],
                    'marketing_slug': 'fake-marketing-slug-xseries-1',
                },
                {
                    'category': 'xseries',
                    'status': 'active',
                    'subtitle': 'Dummy program 2 for testing',
                    'name': 'Second Program',
                    'organization': {'display_name': 'Test Organization 2', 'key': 'edX'},
                    'course_codes': [
                        {
                            'organization': {'display_name': 'Test Organization 2', 'key': 'edX'},
                            'display_name': 'Demo XSeries Program 2',
                            'key': 'TEST_B',
                            'run_modes': [
                                {'sku': '', 'mode_slug': 'XYZ_1', 'course_key': 'edX/Program/Program_Run'},
                            ]
                        }
                    ],
                    'marketing_slug': 'fake-marketing-slug-xseries-2',
                }
            ]
        }

        self.expected_output = {
            'edX/DemoX_1/Run_1': {
                'category': 'xseries',
                'status': 'active',
                'subtitle': 'Dummy program 1 for testing',
                'name': 'First Program',
                'course_codes': [
                    {
                        'organization': {'display_name': 'Test Organization 1', 'key': 'edX'},
                        'display_name': 'Demo XSeries Program 1',
                        'key': 'TEST_A',
                        'run_modes': [
                            {'sku': '', 'mode_slug': 'ABC_1', 'course_key': 'edX/DemoX_1/Run_1'},
                            {'sku': '', 'mode_slug': 'ABC_2', 'course_key': 'edX/DemoX_2/Run_2'},
                        ]
                    }
                ],
                'organization': {'display_name': 'Test Organization 1', 'key': 'edX'},
                'marketing_slug': 'fake-marketing-slug-xseries-1',
            },
            'edX/DemoX_2/Run_2': {
                'category': 'xseries',
                'status': 'active',
                'subtitle': 'Dummy program 1 for testing',
                'name': 'First Program',
                'course_codes': [
                    {
                        'organization': {'display_name': 'Test Organization 1', 'key': 'edX'},
                        'display_name': 'Demo XSeries Program 1',
                        'key': 'TEST_A',
                        'run_modes': [
                            {'sku': '', 'mode_slug': 'ABC_1', 'course_key': 'edX/DemoX_1/Run_1'},
                            {'sku': '', 'mode_slug': 'ABC_2', 'course_key': 'edX/DemoX_2/Run_2'},
                        ]
                    }
                ],
                'organization': {'display_name': 'Test Organization 1', 'key': 'edX'},
                'marketing_slug': 'fake-marketing-slug-xseries-1',
            },
        }

        self.edx_prg_run = {
            'category': 'xseries',
            'status': 'active',
            'subtitle': 'Dummy program 2 for testing',
            'name': 'Second Program',
            'course_codes': [
                {
                    'organization': {'display_name': 'Test Organization 2', 'key': 'edX'},
                    'display_name': 'Demo XSeries Program 2',
                    'key': 'TEST_B',
                    'run_modes': [
                        {'sku': '', 'mode_slug': 'XYZ_1', 'course_key': 'edX/Program/Program_Run'},
                    ]
                }
            ],
            'organization': {'display_name': 'Test Organization 2', 'key': 'edX'},
            'marketing_slug': 'fake-marketing-slug-xseries-2',
        }
Ejemplo n.º 40
0
    def setUp(self, **kwargs):  # pylint: disable=unused-argument
        super(TestGetXSeriesPrograms, self).setUp()
        self.create_config(enabled=True, enable_student_dashboard=True)
        Client.objects.get_or_create(name="programs", client_type=CONFIDENTIAL)
        self.user = UserFactory()
        cache.clear()
        self.programs_api_response = {
            "results": [{
                'category':
                'xseries',
                'status':
                'active',
                'subtitle':
                'Dummy program 1 for testing',
                'name':
                'First Program',
                'organization': {
                    'display_name': 'Test Organization 1',
                    'key': 'edX'
                },
                'course_codes': [{
                    'organization': {
                        'display_name': 'Test Organization 1',
                        'key': 'edX'
                    },
                    'display_name':
                    'Demo XSeries Program 1',
                    'key':
                    'TEST_A',
                    'run_modes': [
                        {
                            'sku': '',
                            'mode_slug': 'ABC_1',
                            'course_key': 'edX/DemoX_1/Run_1'
                        },
                        {
                            'sku': '',
                            'mode_slug': 'ABC_2',
                            'course_key': 'edX/DemoX_2/Run_2'
                        },
                    ]
                }],
                'marketing_slug':
                'fake-marketing-slug-xseries-1',
            }, {
                'category':
                'xseries',
                'status':
                'active',
                'subtitle':
                'Dummy program 2 for testing',
                'name':
                'Second Program',
                'organization': {
                    'display_name': 'Test Organization 2',
                    'key': 'edX'
                },
                'course_codes': [{
                    'organization': {
                        'display_name': 'Test Organization 2',
                        'key': 'edX'
                    },
                    'display_name':
                    'Demo XSeries Program 2',
                    'key':
                    'TEST_B',
                    'run_modes': [
                        {
                            'sku': '',
                            'mode_slug': 'XYZ_1',
                            'course_key': 'edX/Program/Program_Run'
                        },
                    ]
                }],
                'marketing_slug':
                'fake-marketing-slug-xseries-2',
            }]
        }

        self.expected_output = {
            'edX/DemoX_1/Run_1': {
                'category':
                'xseries',
                'status':
                'active',
                'subtitle':
                'Dummy program 1 for testing',
                'name':
                'First Program',
                'course_codes': [{
                    'organization': {
                        'display_name': 'Test Organization 1',
                        'key': 'edX'
                    },
                    'display_name':
                    'Demo XSeries Program 1',
                    'key':
                    'TEST_A',
                    'run_modes': [
                        {
                            'sku': '',
                            'mode_slug': 'ABC_1',
                            'course_key': 'edX/DemoX_1/Run_1'
                        },
                        {
                            'sku': '',
                            'mode_slug': 'ABC_2',
                            'course_key': 'edX/DemoX_2/Run_2'
                        },
                    ]
                }],
                'organization': {
                    'display_name': 'Test Organization 1',
                    'key': 'edX'
                },
                'marketing_slug':
                'fake-marketing-slug-xseries-1',
            },
            'edX/DemoX_2/Run_2': {
                'category':
                'xseries',
                'status':
                'active',
                'subtitle':
                'Dummy program 1 for testing',
                'name':
                'First Program',
                'course_codes': [{
                    'organization': {
                        'display_name': 'Test Organization 1',
                        'key': 'edX'
                    },
                    'display_name':
                    'Demo XSeries Program 1',
                    'key':
                    'TEST_A',
                    'run_modes': [
                        {
                            'sku': '',
                            'mode_slug': 'ABC_1',
                            'course_key': 'edX/DemoX_1/Run_1'
                        },
                        {
                            'sku': '',
                            'mode_slug': 'ABC_2',
                            'course_key': 'edX/DemoX_2/Run_2'
                        },
                    ]
                }],
                'organization': {
                    'display_name': 'Test Organization 1',
                    'key': 'edX'
                },
                'marketing_slug':
                'fake-marketing-slug-xseries-1',
            },
        }

        self.edx_prg_run = {
            'category':
            'xseries',
            'status':
            'active',
            'subtitle':
            'Dummy program 2 for testing',
            'name':
            'Second Program',
            'course_codes': [{
                'organization': {
                    'display_name': 'Test Organization 2',
                    'key': 'edX'
                },
                'display_name':
                'Demo XSeries Program 2',
                'key':
                'TEST_B',
                'run_modes': [
                    {
                        'sku': '',
                        'mode_slug': 'XYZ_1',
                        'course_key': 'edX/Program/Program_Run'
                    },
                ]
            }],
            'organization': {
                'display_name': 'Test Organization 2',
                'key': 'edX'
            },
            'marketing_slug':
            'fake-marketing-slug-xseries-2',
        }
Ejemplo n.º 41
0
 def tearDown(self):
     super(IPFilterFormTest, self).tearDown()
     # Explicitly clear ConfigurationModel's cache so tests have a clear cache
     # and don't interfere with each other
     cache.clear()
Ejemplo n.º 42
0
 def setUp(self):
     super(DashboardTest, self).setUp()
     self.course = CourseFactory.create()
     self.user = UserFactory.create(username="******", email="*****@*****.**", password='******')
     self.client = Client()
     cache.clear()
Ejemplo n.º 43
0
    def setUp(self):
        super(CertificateGenerationEnabledTest, self).setUp()

        # Since model-based configuration is cached, we need
        # to clear the cache before each test.
        cache.clear()
Ejemplo n.º 44
0
    def setUp(self):
        super(CertificateGenerationEnabledTest, self).setUp()

        # Since model-based configuration is cached, we need
        # to clear the cache before each test.
        cache.clear()
Ejemplo n.º 45
0
    def setUp(self):  # pylint: disable=arguments-differ
        super(CertificateGenerationEnabledTest, self).setUp('lms.djangoapps.certificates.api.tracker')  # lint-amnesty, pylint: disable=super-with-arguments

        # Since model-based configuration is cached, we need
        # to clear the cache before each test.
        cache.clear()