Ejemplo n.º 1
0
    def test_start_verification(self, checkpoint_name):
        """Testing start verification service. If checkpoint exists for specific course then returns the checkpoint
        otherwise created that checkpoint.
        """

        rev = ReverificationService()
        rev.start_verification(unicode(self.course_key), checkpoint_name, self.item.location)
        expected_url = ("/verify_student/reverify" "/{course_key}" "/{checkpoint_name}" "/{usage_id}/").format(
            course_key=unicode(self.course_key), checkpoint_name=checkpoint_name, usage_id=self.item.location
        )

        self.assertEqual(
            expected_url, rev.start_verification(unicode(self.course_key), checkpoint_name, self.item.location)
        )
Ejemplo n.º 2
0
    def test_start_verification(self, checkpoint_name):
        """Testing start verification service. If checkpoint exists for specific course then returns the checkpoint
        otherwise created that checkpoint.
        """

        rev = ReverificationService()
        rev.start_verification(unicode(self.course_key), checkpoint_name, self.item.location)
        expected_url = (
            '/verify_student/reverify'
            '/{course_key}'
            '/{checkpoint_name}'
            '/{usage_id}/'
        ).format(course_key=unicode(self.course_key), checkpoint_name=checkpoint_name, usage_id=self.item.location)

        self.assertEqual(
            expected_url, rev.start_verification(unicode(self.course_key), checkpoint_name, self.item.location)
        )
Ejemplo n.º 3
0
    def test_start_verification(self, checkpoint_name):
        """
        Test the 'start_verification' service method. If checkpoint exists for
        a specific course then return the checkpoint otherwise create that
        checkpoint.
        """
        reverification_service = ReverificationService()
        reverification_service.start_verification(unicode(self.course_key), checkpoint_name, self.item.location)
        expected_url = (
            '/verify_student/reverify'
            '/{course_key}'
            '/{checkpoint_name}'
            '/{usage_id}/'
        ).format(course_key=unicode(self.course_key), checkpoint_name=checkpoint_name, usage_id=self.item.location)

        self.assertEqual(
            expected_url,
            reverification_service.start_verification(unicode(self.course_key), checkpoint_name, self.item.location)
        )
Ejemplo n.º 4
0
    def test_start_verification(self, checkpoint_name):
        """Test the 'start_verification' service method.

        Check that if a reverification checkpoint exists for a specific course
        then 'start_verification' method returns that checkpoint otherwise it
        creates that checkpoint.
        """
        reverification_service = ReverificationService()
        checkpoint_location = u'i4x://{org}/{course}/edx-reverification-block/{checkpoint}'.format(
            org=self.course_key.org, course=self.course_key.course, checkpoint=checkpoint_name
        )
        expected_url = (
            '/verify_student/reverify'
            '/{course_key}'
            '/{checkpoint_location}/'
        ).format(course_key=unicode(self.course_key), checkpoint_location=checkpoint_location)

        self.assertEqual(
            reverification_service.start_verification(unicode(self.course_key), checkpoint_location),
            expected_url
        )
Ejemplo n.º 5
0
    def test_start_verification(self, checkpoint_name):
        """Test the 'start_verification' service method.

        Check that if a reverification checkpoint exists for a specific course
        then 'start_verification' method returns that checkpoint otherwise it
        creates that checkpoint.
        """
        reverification_service = ReverificationService()
        checkpoint_location = u'i4x://{org}/{course}/edx-reverification-block/{checkpoint}'.format(
            org=self.course_id.org, course=self.course_id.course, checkpoint=checkpoint_name
        )
        expected_url = (
            '/verify_student/reverify'
            '/{course_key}'
            '/{checkpoint_location}/'
        ).format(course_key=unicode(self.course_id), checkpoint_location=checkpoint_location)

        self.assertEqual(
            reverification_service.start_verification(unicode(self.course_id), checkpoint_location),
            expected_url
        )