Convert Course, Section and Sequence XModules to XBlocks. (#25965)
This commit is contained in:
@@ -250,7 +250,7 @@ class LoginEnrollmentTestCase(TestCase):
|
||||
def enroll(self, course, verify=False):
|
||||
"""
|
||||
Try to enroll and return boolean indicating result.
|
||||
`course` is an instance of CourseDescriptor.
|
||||
`course` is an instance of CourseBlock.
|
||||
`verify` is an optional boolean parameter specifying whether we
|
||||
want to verify that the student was successfully enrolled
|
||||
in the course.
|
||||
@@ -268,7 +268,7 @@ class LoginEnrollmentTestCase(TestCase):
|
||||
def unenroll(self, course):
|
||||
"""
|
||||
Unenroll the currently logged-in user, and check that it worked.
|
||||
`course` is an instance of CourseDescriptor.
|
||||
`course` is an instance of CourseBlock.
|
||||
"""
|
||||
url = reverse('change_enrollment')
|
||||
request_data = {
|
||||
@@ -294,7 +294,7 @@ class CourseAccessTestMixin(TestCase):
|
||||
Arguments:
|
||||
user (User): a user.
|
||||
action (str): type of access to test.
|
||||
course (CourseDescriptor): a course.
|
||||
course (CourseBlock): a course.
|
||||
"""
|
||||
assert has_access(user, action, course)
|
||||
assert has_access(user, action, CourseOverview.get_from_id(course.id))
|
||||
@@ -309,7 +309,7 @@ class CourseAccessTestMixin(TestCase):
|
||||
Arguments:
|
||||
user (User): a user.
|
||||
action (str): type of access to test.
|
||||
course (CourseDescriptor): a course.
|
||||
course (CourseBlock): a course.
|
||||
|
||||
Note:
|
||||
It may seem redundant to have one method for testing access
|
||||
@@ -375,7 +375,7 @@ def masquerade_as_group_member(user, course, partition_id, group_id):
|
||||
|
||||
Arguments:
|
||||
user (User): a user.
|
||||
course (CourseDescriptor): a course.
|
||||
course (CourseBlock): a course.
|
||||
partition_id (int): the integer partition id, referring to partitions already
|
||||
configured in the course.
|
||||
group_id (int); the integer group id, within the specified partition.
|
||||
|
||||
@@ -233,7 +233,7 @@ class AboutTestCase(LoginEnrollmentTestCase, SharedModuleStoreTestCase, EventTra
|
||||
Assert that anonymous or unenrolled users see View Course option
|
||||
when unenrolled access flag is set
|
||||
"""
|
||||
with mock.patch('xmodule.course_module.CourseDescriptor.course_visibility', course_visibility):
|
||||
with mock.patch('xmodule.course_module.CourseBlock.course_visibility', course_visibility):
|
||||
with override_waffle_flag(COURSE_ENABLE_UNENROLLED_ACCESS_FLAG, active=True):
|
||||
url = reverse('about_course', args=[text_type(self.course.id)])
|
||||
resp = self.client.get(url)
|
||||
|
||||
@@ -675,7 +675,7 @@ class UserRoleTestCase(TestCase):
|
||||
@ddt.ddt
|
||||
class CourseOverviewAccessTestCase(ModuleStoreTestCase):
|
||||
"""
|
||||
Tests confirming that has_access works equally on CourseDescriptors and
|
||||
Tests confirming that has_access works equally on CourseBlocks and
|
||||
CourseOverviews.
|
||||
"""
|
||||
|
||||
@@ -739,7 +739,7 @@ class CourseOverviewAccessTestCase(ModuleStoreTestCase):
|
||||
User to test with.
|
||||
action (str): action to test with.
|
||||
course_attr_name (str): the name of the attribute on self that is
|
||||
the CourseDescriptor to test with.
|
||||
the CourseBlock to test with.
|
||||
"""
|
||||
user = getattr(self, user_attr_name)
|
||||
course = getattr(self, course_attr_name)
|
||||
|
||||
@@ -43,7 +43,7 @@ class TestViewAuth(EnterpriseTestConsentRequired, ModuleStoreTestCase, LoginEnro
|
||||
|
||||
`names` is a list of URL names that correspond to sections in a course.
|
||||
|
||||
`course` is the instance of CourseDescriptor whose section URLs are to be returned.
|
||||
`course` is the instance of CourseBlock whose section URLs are to be returned.
|
||||
|
||||
Returns a list URLs corresponding to section in the passed in course.
|
||||
|
||||
@@ -55,7 +55,7 @@ class TestViewAuth(EnterpriseTestConsentRequired, ModuleStoreTestCase, LoginEnro
|
||||
"""
|
||||
Check that non-staff have access to light urls.
|
||||
|
||||
`course` is an instance of CourseDescriptor.
|
||||
`course` is an instance of CourseBlock.
|
||||
"""
|
||||
urls = [reverse('about_course', kwargs={'course_id': text_type(course.id)}),
|
||||
reverse('courses')]
|
||||
|
||||
@@ -270,8 +270,8 @@ class IndexQueryTestCase(ModuleStoreTestCase):
|
||||
NUM_PROBLEMS = 20
|
||||
|
||||
@ddt.data(
|
||||
(ModuleStoreEnum.Type.mongo, 10, 172),
|
||||
(ModuleStoreEnum.Type.split, 4, 168),
|
||||
(ModuleStoreEnum.Type.mongo, 10, 171),
|
||||
(ModuleStoreEnum.Type.split, 4, 167),
|
||||
)
|
||||
@ddt.unpack
|
||||
def test_index_query_counts(self, store_type, expected_mongo_query_count, expected_mysql_query_count):
|
||||
|
||||
Reference in New Issue
Block a user