Support adding cohorts from the instructor dashboard

TNL-162
This commit is contained in:
Andy Armstrong
2014-09-26 15:43:15 -04:00
committed by cahrens
parent b58f7ad7b4
commit 6219ecacfe
23 changed files with 570 additions and 159 deletions

View File

@@ -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)

View File

@@ -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"
)