Skip to content

Commit eac4d15

Browse files
committed
fixup! test: modified field in course block index
1 parent 0547eaf commit eac4d15

File tree

1 file changed

+19
-16
lines changed

1 file changed

+19
-16
lines changed

openedx/core/djangoapps/content/search/tests/test_documents.py

Lines changed: 19 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -52,23 +52,23 @@ class StudioDocumentsTest(SharedModuleStoreTestCase):
5252
def setUpClass(cls):
5353
super().setUpClass()
5454
cls.store = modulestore()
55-
cls.org = Organization.objects.create(name="edX", short_name="edX")
56-
cls.toy_course = ToyCourseFactory.create() # See xmodule/modulestore/tests/sample_courses.py
57-
cls.toy_course_key = cls.toy_course.id
58-
59-
# Get references to some blocks in the toy course
60-
cls.html_block_key = cls.toy_course_key.make_usage_key("html", "toyjumpto")
61-
# Create a problem in course
62-
cls.problem_block = BlockFactory.create(
63-
category="problem",
64-
parent_location=cls.toy_course_key.make_usage_key("vertical", "vertical_test"),
65-
display_name='Test Problem',
66-
data="<problem>What is a test?<multiplechoiceresponse></multiplechoiceresponse></problem>",
67-
)
68-
6955
# Create a library and collection with a block
70-
created_date = datetime(2023, 4, 5, 6, 7, 8, tzinfo=timezone.utc)
71-
with freeze_time(created_date):
56+
cls.created_date = datetime(2023, 4, 5, 6, 7, 8, tzinfo=timezone.utc)
57+
with freeze_time(cls.created_date):
58+
# Get references to some blocks in the toy course
59+
cls.org = Organization.objects.create(name="edX", short_name="edX")
60+
cls.toy_course = ToyCourseFactory.create() # See xmodule/modulestore/tests/sample_courses.py
61+
cls.toy_course_key = cls.toy_course.id
62+
63+
cls.html_block_key = cls.toy_course_key.make_usage_key("html", "toyjumpto")
64+
# Create a problem in course
65+
cls.problem_block = BlockFactory.create(
66+
category="problem",
67+
parent_location=cls.toy_course_key.make_usage_key("vertical", "vertical_test"),
68+
display_name='Test Problem',
69+
data="<problem>What is a test?<multiplechoiceresponse></multiplechoiceresponse></problem>",
70+
)
71+
7272
cls.library = library_api.create_library(
7373
org=cls.org,
7474
slug="2012_Fall",
@@ -190,6 +190,7 @@ def test_problem_block(self):
190190
'usage_key': 'block-v1:edX+toy+2012_Fall+type@vertical+block@vertical_test',
191191
},
192192
],
193+
"modified": self.created_date.timestamp(),
193194
"content": {
194195
"capa_content": "What is a test?",
195196
"problem_types": ["multiplechoiceresponse"],
@@ -223,6 +224,7 @@ def test_html_block(self):
223224
"display_name": "Text",
224225
"description": "This is a link to another page and some Chinese 四節比分和七年前 Some "
225226
"more Chinese 四節比分和七年前 ",
227+
"modified": self.created_date.timestamp(),
226228
"breadcrumbs": [
227229
{
228230
'display_name': 'Toy Course',
@@ -276,6 +278,7 @@ def test_video_block_untagged(self):
276278
},
277279
],
278280
"content": {},
281+
"modified": self.created_date.timestamp(),
279282
# This video has no tags.
280283
}
281284

0 commit comments

Comments
 (0)