Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release Candidate rc/2016-02-23 #11606

Merged
merged 105 commits into from
Feb 24, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
105 commits
Select commit Hold shift + click to select a range
434f196
Remove default django template loaders.
mtyaka Jan 24, 2016
ad9498e
Switch to SharedModuleStoreTestCase in the 'courseware' app where pos…
Feb 5, 2016
6a6ef0f
Fix some broken tests.
Feb 5, 2016
e2ed8ff
Switch to SharedModuleStoreTestCase in the 'student' app where possible.
Feb 3, 2016
982c3e6
Pass DOM element, not jQuery object to XBlock initialisation.
smarnach Feb 4, 2016
97228f3
Update help text for Pages page in Studio to reflect Courseware-Cours…
srpearce Feb 10, 2016
edc9227
TE-1194 update for test_teams.
Feb 10, 2016
f9c3759
Fix self-paced course displaying "published, not yet released" issue…
Feb 4, 2016
4611829
Quality fixes.
Feb 11, 2016
fe9b1a0
add analytics event to thread/comment vote
wajeeha-khalid Feb 4, 2016
3312eb2
refactored code into exclusive functions
wajeeha-khalid Feb 10, 2016
72aeb2c
implemented test event data for thread/comment vote
wajeeha-khalid Feb 11, 2016
b92c12c
MA-1882 adding course api to regex
Feb 11, 2016
60a3029
Close unclosed p tag
Feb 12, 2016
239c382
copy event on write
mulby Feb 11, 2016
df0b983
Improve is_self_paced method
Feb 12, 2016
52d8cb0
MA-1882 adding tests and reworking regex to exclude blocks routes
Feb 12, 2016
ec6a786
Add Randomize XBlock to DEPRECATED_BLOCK_TYPES.
symbolist Feb 12, 2016
5be6d31
Use Course ID in logging an exception
awaisdar001 Feb 10, 2016
21b75f8
Copy this doc up from the bok_choy tests.
jibsheet Feb 11, 2016
1a66726
Merge pull request #11531 from edx/usman/deprecate-randomize
symbolist Feb 12, 2016
7a9fea0
Merge pull request #11450 from edx/jia/MA-1985
wajeeha-khalid Feb 12, 2016
4037b16
Merge pull request #11519 from edx/jibsheet/document-nose-breakpoints…
jibsheet Feb 12, 2016
4c79aba
Merge pull request #11527 from edx/renzo/unclosed-p-tag
Feb 12, 2016
7a6495c
Add monitoring version of package.json
andy-armstrong Jan 25, 2016
8a62064
Disable credentials-related settings/tests under cms.
Feb 11, 2016
46ad8a3
specify routing / queue for program credentials task.
Feb 12, 2016
b46648e
Merge pull request #11528 from edx/andya/add-js-monitoring-package
andy-armstrong Feb 12, 2016
c692268
Install underscore from npm.
Feb 12, 2016
526e174
Merge pull request #11510 from edx/benp/TE-1194-example
Feb 12, 2016
b6ca05d
Add accidentally deleted lettuce DB cache.
Feb 12, 2016
fb3a09e
Merge pull request #11520 from edx/jsa/ecom-3638
Feb 12, 2016
fcfb0f4
Merge pull request #11522 from edx/gabe/remove-ga-fields
mulby Feb 12, 2016
f71e7ca
adjust comment about program certification retry
Feb 12, 2016
a052a30
Merge pull request #11539 from edx/jsa/fix-retry-comment
Feb 12, 2016
36fc616
Merge pull request #11534 from edx/christina/jquery-npm
Feb 12, 2016
5e9577b
Merge pull request #11535 from edx/peter-fogg/add-lettuce-cache
Feb 12, 2016
75f17ec
correct FAVICON_PATH setting for comprehensive theming
saleem-latif Feb 10, 2016
3559bd1
Refactor test to check support for both modulestore and is_self_paced…
Feb 15, 2016
8280e22
Merge pull request #11433 from open-craft/smarnach/studio-add-xblock
smarnach Feb 15, 2016
97593f1
Add Drag-and-drop XBlock to requirements.
Kelketek Jan 28, 2016
ead2f04
Quality fixes.
Feb 16, 2016
6cd2657
fixed get_template_path to work with absolute path also
ziafazal Feb 15, 2016
cd101d5
Merge pull request #11494 from edx/saleem-latif/WL-307
saleem-latif Feb 16, 2016
49d3a7d
More quality fixes.
Feb 16, 2016
57af11c
Merge pull request #11548 from edx/ziafazal/fix-get-template-path
ziafazal Feb 16, 2016
31853d4
Merge pull request #11495 from edx/aj/tnl4115-improve-log-get-course-…
awaisdar001 Feb 16, 2016
d532f8d
Render LMS main navigation (tabs) with template, override templates f…
dmitry-viskov Dec 26, 2015
e2cbb54
Switch to SharedModuleStoreTestCase in the 'contentstore' app where p…
Feb 16, 2016
2f595c1
ECOM-3640 add a new info log message on program certificate task to m…
schenedx Feb 16, 2016
9654449
Merge pull request #11465 from edx/perf/speed-up-courseware-tests
tobz Feb 16, 2016
fe545e0
Quality fixes.
Feb 16, 2016
0d040bc
Fix a mistake with initializing something in the test setup.
Feb 16, 2016
f6fc711
ECOM-3177 fix the flaky js test by doing dependency injection
schenedx Feb 11, 2016
4b8a737
Merge pull request #11553 from edx/schen/ECOM-3640
schenedx Feb 16, 2016
b68beea
Merge pull request #11508 from edx/sylvia/DOC-2692
srpearce Feb 16, 2016
af102a6
Remove duplicate test setup.
Feb 16, 2016
a858bb9
Update screenshot for Help modal on Pages page
srpearce Feb 16, 2016
ddd7b61
Merge pull request #11364 from edx/kelketek/drag-and-drop
Kelketek Feb 16, 2016
3fa62a6
Merge pull request #11416 from edx/schen/ECOM-3177
schenedx Feb 16, 2016
b69c6d6
Make base.html Mako template safe by default
robrap Dec 23, 2015
b9ccff7
Merge pull request #11557 from edx/sylvia/DOC-2692-2
srpearce Feb 16, 2016
d3c88d7
Merge pull request #11552 from edx/perf/speed-up-contentstore-tests
tobz Feb 16, 2016
6cc8bbf
Merge pull request #11059 from edx/robrap/TNL-3425
robrap Feb 16, 2016
d3fc262
Code refactor pass store_type in course create method
Feb 17, 2016
faf3a64
Bypass unnecessary logs on loging out
Qubad786 Feb 9, 2016
91bf48f
Added staff role on ccx to staff of master course and added a data mi…
amir-qayyum-khan Nov 23, 2015
5485d0c
make `is_course_self_paced` default to False
Feb 17, 2016
af9e26f
Merge pull request #11479 from edx/mrehan/plat-998-warnings-on-logout
Qubad786 Feb 17, 2016
2a4e141
LMS: fixing skip links and adding a11y tests
Sep 24, 2015
88df456
set show_full_result_count false
Feb 17, 2016
b94204a
Merge pull request #11452 from edx/mushtaq/ECOM-3615-fix-self-paced-s…
Feb 17, 2016
21aa7ed
Merge pull request #9909 from edx/clrux/ac-179
Feb 17, 2016
45f8e52
making check more generic
Feb 12, 2016
d90c1a2
Merge pull request #11560 from edx/ahsan/ECOM-2831-GeneratedCertifica…
Feb 17, 2016
e4b59c3
Merge pull request #11526 from edx/sstudent/MA-1882-update-api-regex
Feb 17, 2016
80c68e4
Merge pull request #11467 from edx/perf/speed-up-student-tests
tobz Feb 17, 2016
eb914a0
Merge pull request #11564 from edx/release
nasthagiri Feb 17, 2016
86a4710
Otto checkout flow
vkaracic Feb 17, 2016
619420b
Add API endpoint for issuing programs certificates
Feb 11, 2016
2312b22
Merge pull request #11503 from edx/coupons/otto-checkout
vkaracic Feb 17, 2016
885785d
Added a UI for confirming OAuth Access.
justinabrahms Feb 8, 2016
922269f
Merge pull request #11464 from mitocw/oauth-confirmation-views
clintonb Feb 17, 2016
62d07c9
Merge pull request #11541 from edx/renzo/manual-cert-trigger
Feb 17, 2016
6c3ae82
Update translations (autogenerated message)
Feb 17, 2016
080b7d7
Merge pull request #11572 from edx/ned/update-translations
nedbat Feb 17, 2016
1a5fa4b
removes alt attribute value
cptvitamin Feb 17, 2016
e8ccc2f
Merge pull request #11076 from CredoReference/render-lms-main-navigat…
ziafazal Feb 18, 2016
dcb04cb
Merge pull request #10877 from mitocw/enhancement/aq/add_master_cours…
pdpinch Feb 18, 2016
7a9991e
Studio homepage escaping
Jan 28, 2016
689bb73
Merge pull request #11551 from edx/mushtaq/fix-tnl4006
Feb 18, 2016
94d5b5d
Merge pull request #11576 from edx/cptvitamin/AC-332
Feb 18, 2016
f4e462c
Merge pull request #11316 from open-craft/remove-django-template-loaders
mtyaka Feb 18, 2016
5903ef8
Merge pull request #11584 from edx/release
mjfrey Feb 18, 2016
920cc3d
Inform openassessment to clear submission
Feb 4, 2016
09d0f43
Merge pull request #11422 from edx/efischer/reset_state_fix
Feb 18, 2016
4dbcf9a
Merge pull request #11587 from edx/release
adampalay Feb 18, 2016
4a246dd
Upgraded edx-proctoring to 0.12.10
Feb 19, 2016
5095224
Using display_name_with_default instead of display_name.
Feb 16, 2016
4be5aeb
Merge pull request #11550 from edx/muzaffar/tnl4013
symbolist Feb 19, 2016
8f7c158
Merge pull request #11594 from edx/douglashall/edx_proctoring_0_12_10
Feb 19, 2016
bf5d203
Revert "Added staff role on ccx to staff of master course and added a…
mikekatz Feb 22, 2016
73fa319
Revert "Inform openassessment to clear submission"
Feb 22, 2016
5e38030
keep version bumps
Feb 23, 2016
67b128d
Merge pull request #11625 from edx/efischer/revert_ora_release
Feb 23, 2016
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 28 additions & 1 deletion cms/djangoapps/contentstore/tests/test_course_listing.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@
import ddt

from django.test import RequestFactory
from django.test.client import Client

from common.test.utils import XssTestMixin
from xmodule.course_module import CourseSummary

from contentstore.views.course import (_accessible_courses_list, _accessible_courses_list_from_groups,
Expand All @@ -30,7 +33,7 @@


@ddt.ddt
class TestCourseListing(ModuleStoreTestCase):
class TestCourseListing(ModuleStoreTestCase, XssTestMixin):
"""
Unit tests for getting the list of courses for a logged in user
"""
Expand Down Expand Up @@ -72,6 +75,30 @@ def tearDown(self):
self.client.logout()
ModuleStoreTestCase.tearDown(self)

def test_course_listing_is_escaped(self):
"""
Tests course listing returns escaped data.
"""
escaping_content = "<script>alert('ESCAPE')</script>"

# Make user staff to access course listing
self.user.is_staff = True
self.user.save() # pylint: disable=no-member

self.client = Client()
self.client.login(username=self.user.username, password='test')

# Change 'display_coursenumber' field and update the course.
course = CourseFactory.create()
course.display_coursenumber = escaping_content
course = self.store.update_item(course, self.user.id) # pylint: disable=no-member
self.assertEqual(course.display_coursenumber, escaping_content)

# Check if response is escaped
response = self.client.get('/home')
self.assertEqual(response.status_code, 200)
self.assert_no_xss(response, escaping_content)

def test_get_course_list(self):
"""
Test getting courses with new access group format e.g. 'instructor_edx.course.run'
Expand Down
41 changes: 20 additions & 21 deletions cms/djangoapps/contentstore/tests/test_courseware_index.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,12 @@
from xmodule.modulestore import ModuleStoreEnum
from xmodule.modulestore.django import SignalHandler, modulestore
from xmodule.modulestore.edit_info import EditInfoMixin
from xmodule.modulestore.exceptions import ItemNotFoundError
from xmodule.modulestore.inheritance import InheritanceMixin
from xmodule.modulestore.mixed import MixedModuleStore
from xmodule.modulestore.tests.django_utils import (
ModuleStoreTestCase,
TEST_DATA_MONGO_MODULESTORE,
TEST_DATA_SPLIT_MODULESTORE
)
TEST_DATA_SPLIT_MODULESTORE,
SharedModuleStoreTestCase)
from xmodule.modulestore.tests.factories import CourseFactory, ItemFactory, LibraryFactory
from xmodule.modulestore.tests.mongo_connection import MONGO_PORT_NUM, MONGO_HOST
from xmodule.modulestore.tests.utils import (
Expand Down Expand Up @@ -692,60 +690,61 @@ def test_large_course_deletion(self, store_type):
self._perform_test_using_store(store_type, self._test_large_course_deletion)


class TestTaskExecution(ModuleStoreTestCase):
class TestTaskExecution(SharedModuleStoreTestCase):
"""
Set of tests to ensure that the task code will do the right thing when
executed directly. The test course and library gets created without the listeners
being present, which allows us to ensure that when the listener is
executed, it is done as expected.
"""

def setUp(self):
super(TestTaskExecution, self).setUp()
@classmethod
def setUpClass(cls):
super(TestTaskExecution, cls).setUpClass()
SignalHandler.course_published.disconnect(listen_for_course_publish)
SignalHandler.library_updated.disconnect(listen_for_library_update)
self.course = CourseFactory.create(start=datetime(2015, 3, 1, tzinfo=UTC))
cls.course = CourseFactory.create(start=datetime(2015, 3, 1, tzinfo=UTC))

self.chapter = ItemFactory.create(
parent_location=self.course.location,
cls.chapter = ItemFactory.create(
parent_location=cls.course.location,
category='chapter',
display_name="Week 1",
publish_item=True,
start=datetime(2015, 3, 1, tzinfo=UTC),
)
self.sequential = ItemFactory.create(
parent_location=self.chapter.location,
cls.sequential = ItemFactory.create(
parent_location=cls.chapter.location,
category='sequential',
display_name="Lesson 1",
publish_item=True,
start=datetime(2015, 3, 1, tzinfo=UTC),
)
self.vertical = ItemFactory.create(
parent_location=self.sequential.location,
cls.vertical = ItemFactory.create(
parent_location=cls.sequential.location,
category='vertical',
display_name='Subsection 1',
publish_item=True,
start=datetime(2015, 4, 1, tzinfo=UTC),
)
# unspecified start - should inherit from container
self.html_unit = ItemFactory.create(
parent_location=self.vertical.location,
cls.html_unit = ItemFactory.create(
parent_location=cls.vertical.location,
category="html",
display_name="Html Content",
publish_item=False,
)

self.library = LibraryFactory.create()
cls.library = LibraryFactory.create()

self.library_block1 = ItemFactory.create(
parent_location=self.library.location,
cls.library_block1 = ItemFactory.create(
parent_location=cls.library.location,
category="html",
display_name="Html Content",
publish_item=False,
)

self.library_block2 = ItemFactory.create(
parent_location=self.library.location,
cls.library_block2 = ItemFactory.create(
parent_location=cls.library.location,
category="html",
display_name="Html Content 2",
publish_item=False,
Expand Down
45 changes: 24 additions & 21 deletions cms/djangoapps/contentstore/tests/test_transcripts_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

from xmodule.modulestore.tests.factories import CourseFactory
from xmodule.contentstore.content import StaticContent
from xmodule.modulestore.tests.django_utils import ModuleStoreTestCase
from xmodule.modulestore.tests.django_utils import SharedModuleStoreTestCase
from xmodule.exceptions import NotFoundError
from xmodule.contentstore.django import contentstore
from xmodule.video_module import transcripts_utils
Expand Down Expand Up @@ -77,7 +77,7 @@ def test_generate_subs_decrease_speed_2(self):


@override_settings(CONTENTSTORE=TEST_DATA_CONTENTSTORE)
class TestSaveSubsToStore(ModuleStoreTestCase):
class TestSaveSubsToStore(SharedModuleStoreTestCase):
"""Tests for `save_subs_to_store` function."""

org = 'MITx'
Expand All @@ -92,13 +92,13 @@ def clear_subs_content(self):
except NotFoundError:
pass

def setUp(self):

super(TestSaveSubsToStore, self).setUp()
self.course = CourseFactory.create(
org=self.org, number=self.number, display_name=self.display_name)
@classmethod
def setUpClass(cls):
super(TestSaveSubsToStore, cls).setUpClass()
cls.course = CourseFactory.create(
org=cls.org, number=cls.number, display_name=cls.display_name)

self.subs = {
cls.subs = {
'start': [100, 200, 240, 390, 1000],
'end': [200, 240, 380, 1000, 1500],
'text': [
Expand All @@ -110,18 +110,20 @@ def setUp(self):
]
}

self.subs_id = str(uuid4())
filename = 'subs_{0}.srt.sjson'.format(self.subs_id)
self.content_location = StaticContent.compute_location(self.course.id, filename)
self.addCleanup(self.clear_subs_content)
cls.subs_id = str(uuid4())
filename = 'subs_{0}.srt.sjson'.format(cls.subs_id)
cls.content_location = StaticContent.compute_location(cls.course.id, filename)

# incorrect subs
self.unjsonable_subs = set([1]) # set can't be serialized
cls.unjsonable_subs = {1} # set can't be serialized

self.unjsonable_subs_id = str(uuid4())
filename_unjsonable = 'subs_{0}.srt.sjson'.format(self.unjsonable_subs_id)
self.content_location_unjsonable = StaticContent.compute_location(self.course.id, filename_unjsonable)
cls.unjsonable_subs_id = str(uuid4())
filename_unjsonable = 'subs_{0}.srt.sjson'.format(cls.unjsonable_subs_id)
cls.content_location_unjsonable = StaticContent.compute_location(cls.course.id, filename_unjsonable)

def setUp(self):
super(TestSaveSubsToStore, self).setUp()
self.addCleanup(self.clear_subs_content)
self.clear_subs_content()

def test_save_subs_to_store(self):
Expand Down Expand Up @@ -154,7 +156,7 @@ def test_save_unjsonable_subs_to_store(self):


@override_settings(CONTENTSTORE=TEST_DATA_CONTENTSTORE)
class TestDownloadYoutubeSubs(ModuleStoreTestCase):
class TestDownloadYoutubeSubs(SharedModuleStoreTestCase):
"""Tests for `download_youtube_subs` function."""

org = 'MITx'
Expand Down Expand Up @@ -182,10 +184,11 @@ def clear_subs_content(self, youtube_subs):
for subs_id in youtube_subs.values():
self.clear_sub_content(subs_id)

def setUp(self):
super(TestDownloadYoutubeSubs, self).setUp()
self.course = CourseFactory.create(
org=self.org, number=self.number, display_name=self.display_name)
@classmethod
def setUpClass(cls):
super(TestDownloadYoutubeSubs, cls).setUpClass()
cls.course = CourseFactory.create(
org=cls.org, number=cls.number, display_name=cls.display_name)

def test_success_downloading_subs(self):

Expand Down
31 changes: 16 additions & 15 deletions cms/djangoapps/contentstore/tests/test_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
from django.test.utils import override_settings
from xmodule.modulestore import ModuleStoreEnum
from xmodule.modulestore.tests.factories import CourseFactory, ItemFactory
from xmodule.modulestore.tests.django_utils import ModuleStoreTestCase
from xmodule.modulestore.tests.django_utils import ModuleStoreTestCase, SharedModuleStoreTestCase
from opaque_keys.edx.locations import SlashSeparatedCourseKey
from xmodule.modulestore.django import modulestore
from xmodule.partitions.partitions import UserPartition, Group
Expand Down Expand Up @@ -110,16 +110,17 @@ def get_course_with_tabs(self, tabs=None):
return course


class XBlockVisibilityTestCase(ModuleStoreTestCase):
class XBlockVisibilityTestCase(SharedModuleStoreTestCase):
"""Tests for xblock visibility for students."""

def setUp(self):
super(XBlockVisibilityTestCase, self).setUp()
@classmethod
def setUpClass(cls):
super(XBlockVisibilityTestCase, cls).setUpClass()

self.dummy_user = ModuleStoreEnum.UserID.test
self.past = datetime(1970, 1, 1, tzinfo=UTC)
self.future = datetime.now(UTC) + timedelta(days=1)
self.course = CourseFactory.create()
cls.dummy_user = ModuleStoreEnum.UserID.test
cls.past = datetime(1970, 1, 1, tzinfo=UTC)
cls.future = datetime.now(UTC) + timedelta(days=1)
cls.course = CourseFactory.create()

def test_private_unreleased_xblock(self):
"""Verifies that a private unreleased xblock is not visible"""
Expand Down Expand Up @@ -484,31 +485,31 @@ def test_retrieves_partition_info_with_selected_groups(self):
expected = [
{
"id": 0,
"name": "Cohort user partition",
"scheme": "cohort",
"name": u"Cohort user partition",
"scheme": u"cohort",
"groups": [
{
"id": 0,
"name": "Group A",
"name": u"Group A",
"selected": False,
"deleted": False,
},
{
"id": 1,
"name": "Group B",
"name": u"Group B",
"selected": False,
"deleted": False,
},
]
},
{
"id": 1,
"name": "Random user partition",
"scheme": "random",
"name": u"Random user partition",
"scheme": u"random",
"groups": [
{
"id": 0,
"name": "Group C",
"name": u"Group C",
"selected": False,
"deleted": False,
},
Expand Down
9 changes: 9 additions & 0 deletions cms/djangoapps/contentstore/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
from django_comment_common.models import assign_default_role
from django_comment_common.utils import seed_permissions_roles

from openedx.core.djangoapps.self_paced.models import SelfPacedConfiguration

from xmodule.modulestore import ModuleStoreEnum
from xmodule.modulestore.django import modulestore
from xmodule.modulestore.exceptions import ItemNotFoundError
Expand Down Expand Up @@ -455,3 +457,10 @@ def get_visibility_partition_info(xblock):
"has_selected_groups": has_selected_groups,
"selected_verified_partition_id": selected_verified_partition_id,
}


def is_self_paced(course):
"""
Returns True if course is self-paced, False otherwise.
"""
return course and course.self_paced and SelfPacedConfiguration.current().enabled
14 changes: 9 additions & 5 deletions cms/djangoapps/contentstore/views/item.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@
from contentstore.views.helpers import is_unit, xblock_studio_url, xblock_primary_child_category, \
xblock_type_display_name, get_parent_xblock, create_xblock, usage_key_with_run
from contentstore.views.preview import get_preview_fragment
from contentstore.utils import is_self_paced

from openedx.core.lib.gating import api as gating_api
from edxmako.shortcuts import render_to_string
from models.settings.course_grading import CourseGradingModel
Expand Down Expand Up @@ -855,7 +857,9 @@ def create_xblock_info(xblock, data=None, metadata=None, include_ancestor_info=F
release_date = _get_release_date(xblock, user)

if xblock.category != 'course':
visibility_state = _compute_visibility_state(xblock, child_info, is_xblock_unit and has_changes)
visibility_state = _compute_visibility_state(
xblock, child_info, is_xblock_unit and has_changes, is_self_paced(course)
)
else:
visibility_state = None
published = modulestore().has_published_version(xblock) if not is_library_block else None
Expand Down Expand Up @@ -1017,7 +1021,7 @@ class VisibilityState(object):
gated = 'gated'


def _compute_visibility_state(xblock, child_info, is_unit_with_changes):
def _compute_visibility_state(xblock, child_info, is_unit_with_changes, is_course_self_paced=False):
"""
Returns the current publish state for the specified xblock and its children
"""
Expand All @@ -1027,10 +1031,10 @@ def _compute_visibility_state(xblock, child_info, is_unit_with_changes):
# Note that a unit that has never been published will fall into this category,
# as well as previously published units with draft content.
return VisibilityState.needs_attention

is_unscheduled = xblock.start == DEFAULT_START_DATE
is_live = datetime.now(UTC) > xblock.start
children = child_info and child_info.get('children', [])
if children and len(children) > 0:
is_live = is_course_self_paced or datetime.now(UTC) > xblock.start
if child_info and child_info.get('children', []):
all_staff_only = True
all_unscheduled = True
all_live = True
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#-*- coding: utf-8 -*-

"""
Group Configuration Tests.
Certificates Tests.
"""
import json
import mock
Expand Down
Loading