Fixes after rebase.
This commit is contained in:
@@ -36,10 +36,10 @@ class TestMultipleCohortUsers(ModuleStoreTestCase):
|
||||
"""
|
||||
# set two auto_cohort_groups for both courses
|
||||
config_course_cohorts(
|
||||
self.course1, [], cohorted=True, auto_cohort_groups=["Course1AutoGroup1", "Course1AutoGroup2"]
|
||||
self.course1, is_cohorted=True, auto_cohorts=["Course1AutoGroup1", "Course1AutoGroup2"]
|
||||
)
|
||||
config_course_cohorts(
|
||||
self.course2, [], cohorted=True, auto_cohort_groups=["Course2AutoGroup1", "Course2AutoGroup2"]
|
||||
self.course2, is_cohorted=True, auto_cohorts=["Course2AutoGroup1", "Course2AutoGroup2"]
|
||||
)
|
||||
|
||||
# get the cohorts from the courses, which will cause auto cohorts to be created
|
||||
|
||||
@@ -7,6 +7,9 @@ import json
|
||||
|
||||
from collections import namedtuple
|
||||
from datetime import datetime
|
||||
from unittest import skipUnless
|
||||
|
||||
from django.conf import settings
|
||||
from django.contrib.auth.models import User
|
||||
from django.http import Http404
|
||||
from django.test.client import RequestFactory
|
||||
@@ -1193,6 +1196,7 @@ class RemoveUserFromCohortTestCase(CohortViewsTestCase):
|
||||
self.verify_removed_user_from_cohort(user.username, response_dict, cohort)
|
||||
|
||||
|
||||
@skipUnless(settings.ROOT_URLCONF == 'lms.urls', 'Tests only valid in LMS')
|
||||
class CourseCohortDiscussionTopicsTestCase(CohortViewsTestCase):
|
||||
"""
|
||||
Tests the `cohort_discussion_topics` view.
|
||||
|
||||
@@ -103,7 +103,7 @@ def get_cohorted_discussions(course, course_settings):
|
||||
cohorted_inline_discussions = []
|
||||
|
||||
course_wide_discussions = [topic['id'] for __, topic in course.discussion_topics.items()]
|
||||
all_discussions = get_discussion_categories_ids(course, include_all=True)
|
||||
all_discussions = get_discussion_categories_ids(course, None, include_all=True)
|
||||
|
||||
for cohorted_discussion_id in course_settings.cohorted_discussions:
|
||||
if cohorted_discussion_id in course_wide_discussions:
|
||||
@@ -462,7 +462,9 @@ def cohort_discussion_topics(request, course_key_string):
|
||||
course = get_course_with_access(request.user, 'staff', course_key)
|
||||
|
||||
discussion_topics = {}
|
||||
discussion_category_map = get_discussion_category_map(course, cohorted_if_in_list=True, exclude_unstarted=False)
|
||||
discussion_category_map = get_discussion_category_map(
|
||||
course, request.user, cohorted_if_in_list=True, exclude_unstarted=False
|
||||
)
|
||||
|
||||
# We extract the data for the course wide discussions from the category map.
|
||||
course_wide_entries = discussion_category_map.pop('entries')
|
||||
|
||||
Reference in New Issue
Block a user