Skip to content

Commit fdae7b8

Browse files
committed
tmp: More changes to the test.
1 parent 6e5db47 commit fdae7b8

3 files changed

Lines changed: 19 additions & 14 deletions

File tree

lms/djangoapps/courseware/tests/test_access.py

Lines changed: 15 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -246,18 +246,22 @@ def test_student_has_access(self):
246246
chapter = BlockFactory.create(category="chapter", parent_location=self.course.location)
247247
overview = CourseOverview.get_from_id(course_key)
248248
subsection = BlockFactory.create(category="sequential", parent_location=chapter.location)
249-
unit = BlockFactory.create(category="vertical", parent_location=subsection.location)
250-
html_block = BlockFactory.create(
251-
category="html",
252-
parent_location=unit.location,
253-
display_name = "Unpublished Block",
254-
data = '<p>This block should not be published.</p>',
255-
publish_item = False,
256-
# Not ideal but does ensure that the student doesn't have access. Not really
257-
# testing what we want though.
258-
visible_to_staff_only=True,
259-
)
260249

250+
with self.store.branch_setting(ModuleStoreEnum.Branch.draft_preferred):
251+
unit = BlockFactory.create(category="vertical", parent_location=subsection.location)
252+
html_block = BlockFactory.create(
253+
category="html",
254+
parent_location=unit.location,
255+
display_name = "Unpublished Block",
256+
data = '<p>This block should not be published.</p>',
257+
publish_item = False,
258+
# Not ideal but does ensure that the student doesn't have access. Not really
259+
# testing what we want though.
260+
# visible_to_staff_only=True,
261+
)
262+
print(self.store.get_branch_setting())
263+
264+
print(self.store.get_branch_setting())
261265
# Enroll student to the course
262266
CourseEnrollmentFactory(user=self.student, course_id=self.course.id)
263267

lms/envs/common.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1861,7 +1861,7 @@ def _make_mako_template_dirs(settings):
18611861
SESSION_COOKIE_NAME = 'sessionid'
18621862

18631863
# django-session-cookie middleware
1864-
DCS_SESSION_COOKIE_SAMESITE = 'None'
1864+
DCS_SESSION_COOKIE_SAMESITE = 'Lax'
18651865
DCS_SESSION_COOKIE_SAMESITE_FORCE_ALL = True
18661866

18671867
# This is the domain that is used to set shared cookies between various sub-domains.

lms/envs/devstack.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,8 @@
6262
'class': 'logging.NullHandler',
6363
}
6464

65-
LOGGING['loggers']['tracking']['handlers'] = ['console']
65+
LOGGING['loggers']['tracking']['handlers'] = []
66+
LOGGING['loggers']['']['handlers'] = []
6667

6768
################################ EMAIL ########################################
6869

@@ -80,7 +81,7 @@
8081

8182
################################ DEBUG TOOLBAR ################################
8283

83-
INSTALLED_APPS += ['debug_toolbar']
84+
INSTALLED_APPS += ['debug_toolbar', 'django_extensions']
8485
MIDDLEWARE += [
8586
'lms.djangoapps.discussion.django_comment_client.utils.QueryCountDebugMiddleware',
8687
'debug_toolbar.middleware.DebugToolbarMiddleware',

0 commit comments

Comments
 (0)