Skip to content

Commit

Permalink
fix: fixed failing test cases
Browse files Browse the repository at this point in the history
  • Loading branch information
ayesha-waris committed Jun 4, 2024
1 parent d735c63 commit f7963b2
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 1 addition & 1 deletion lms/djangoapps/ccx/tests/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ class CcxTestCase(EmailTemplateTagMixin, SharedModuleStoreTestCase):
@classmethod
def setUpClass(cls):
super().setUpClass()
cls.course = course = CourseFactory.create(enable_ccx=True)
cls.course = course = CourseFactory.create(enable_ccx=True, posting_restrictions=True)

# Create a course outline
cls.mooc_start = start = datetime.datetime(
Expand Down
5 changes: 5 additions & 0 deletions xmodule/modulestore/tests/factories.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ class XModuleFactoryLock(threading.local):
after ensuring that a) the modulestore will be cleaned up, and b) that XModuleFactoryLock.disable
will be called.
"""

def __init__(self):
super().__init__()
self._enabled = False
Expand Down Expand Up @@ -123,6 +124,9 @@ def _create(cls, target_class, **kwargs): # lint-amnesty, pylint: disable=argum
run = kwargs.pop('run', name)
user_id = kwargs.pop('user_id', ModuleStoreEnum.UserID.test)
emit_signals = kwargs.pop('emit_signals', False)

if kwargs.pop('posting_restrictions', None):
kwargs['discussions_settings'] = {'posting_restrictions': 'scheduled'}
# By default course has enrollment_start in the future which means course is closed for enrollment.
# We're setting the 'enrollment_start' field to None to reduce number of arguments needed to setup course.
# Use the 'default_enrollment_start=True' kwarg to skip this and use the default enrollment_start date.
Expand Down Expand Up @@ -478,6 +482,7 @@ class StackTraceCounter:
"""
A class that counts unique stack traces underneath a particular stack frame.
"""

def __init__(self, stack_depth, include_arguments=True):
"""
Arguments:
Expand Down

0 comments on commit f7963b2

Please sign in to comment.