コード例 #1
0
class ProgramEnrollmentAdminTests(TestCase):
    """
    Unit tests for the ProgramEnrollments app.  This just gives us a little
    protection against exposing high-cardinality fields as drop-downs, exposing
    new fields, etc.
    """
    def setUp(self):
        super(ProgramEnrollmentAdminTests, self).setUp()
        self.program_admin = ProgramEnrollmentAdmin(ProgramEnrollment,
                                                    AdminSite())
        self.program_course_admin = ProgramCourseEnrollmentAdmin(
            ProgramCourseEnrollment, AdminSite())

    def test_program_enrollment_admin(self):
        request = mock.Mock()
        expected_list_display = ('id', 'status', 'user', 'external_user_key',
                                 'program_uuid', 'curriculum_uuid')
        assert expected_list_display == self.program_admin.get_list_display(
            request)
        expected_raw_id_fields = ('user', )
        assert expected_raw_id_fields == self.program_admin.raw_id_fields

    def test_program_course_enrollment_admin(self):
        expected_raw_id_fields = ('program_enrollment', 'course_enrollment')
        assert expected_raw_id_fields == self.program_course_admin.raw_id_fields
コード例 #2
0
ファイル: test_admin.py プロジェクト: edx/edx-platform
class ProgramEnrollmentAdminTests(TestCase):
    """
    Unit tests for the ProgramEnrollments app.  This just gives us a little
    protection against exposing high-cardinality fields as drop-downs, exposing
    new fields, etc.
    """
    def setUp(self):
        super(ProgramEnrollmentAdminTests, self).setUp()
        self.program_admin = ProgramEnrollmentAdmin(ProgramEnrollment, AdminSite())
        self.program_course_admin = ProgramCourseEnrollmentAdmin(ProgramCourseEnrollment, AdminSite())

    def test_program_enrollment_admin(self):
        request = mock.Mock()

        expected_list_display = ('id', 'user', 'external_user_key', 'program_uuid', 'curriculum_uuid', 'status')
        assert expected_list_display == self.program_admin.get_list_display(request)
        expected_raw_id_fields = ('user',)
        assert expected_raw_id_fields == self.program_admin.raw_id_fields

    def test_program_course_enrollment_admin(self):
        request = mock.Mock()

        expected_list_display = ('id', 'program_enrollment', 'course_enrollment', 'course_key', 'status')
        assert expected_list_display == self.program_course_admin.get_list_display(request)
        expected_raw_id_fields = ('program_enrollment', 'course_enrollment')
        assert expected_raw_id_fields == self.program_course_admin.raw_id_fields
コード例 #3
0
 def setUp(self):
     super(ProgramEnrollmentAdminTests, self).setUp()
     self.program_admin = ProgramEnrollmentAdmin(ProgramEnrollment,
                                                 AdminSite())
     self.program_course_admin = ProgramCourseEnrollmentAdmin(
         ProgramCourseEnrollment, AdminSite())
コード例 #4
0
ファイル: test_admin.py プロジェクト: sliva/edx-platform
 def setUp(self):
     super(ProgramEnrollmentAdminTests, self).setUp()  # lint-amnesty, pylint: disable=super-with-arguments
     self.program_admin = ProgramEnrollmentAdmin(ProgramEnrollment,
                                                 AdminSite())
     self.program_course_admin = ProgramCourseEnrollmentAdmin(
         ProgramCourseEnrollment, AdminSite())
コード例 #5
0
ファイル: test_admin.py プロジェクト: edx/edx-platform
 def setUp(self):
     super(ProgramEnrollmentAdminTests, self).setUp()
     self.program_admin = ProgramEnrollmentAdmin(ProgramEnrollment, AdminSite())
     self.program_course_admin = ProgramCourseEnrollmentAdmin(ProgramCourseEnrollment, AdminSite())