Support adding cohorts from the instructor dashboard
TNL-162
This commit is contained in:
@@ -9,6 +9,9 @@ from xmodule.modulestore import ModuleStoreEnum
|
||||
|
||||
|
||||
class CohortFactory(DjangoModelFactory):
|
||||
"""
|
||||
Factory for constructing mock cohorts.
|
||||
"""
|
||||
FACTORY_FOR = CourseUserGroup
|
||||
|
||||
name = Sequence("cohort{}".format)
|
||||
@@ -17,6 +20,9 @@ class CohortFactory(DjangoModelFactory):
|
||||
|
||||
@post_generation
|
||||
def users(self, create, extracted, **kwargs): # pylint: disable=W0613
|
||||
"""
|
||||
Returns the users associated with the cohort.
|
||||
"""
|
||||
if extracted:
|
||||
self.users.add(*extracted)
|
||||
|
||||
|
||||
@@ -277,7 +277,7 @@ class AddCohortTestCase(CohortViewsTestCase):
|
||||
self.verify_contains_added_cohort(
|
||||
self.request_add_cohort(cohort_name, self.course),
|
||||
cohort_name,
|
||||
expected_error_msg="Can't create two cohorts with the same name"
|
||||
expected_error_msg="You cannot create two cohorts with the same name"
|
||||
)
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user