@@ -405,13 +405,13 @@ def test_migrate_component_with_static_content(self):
405405 olx = '<problem display_name="Test Problem"><p>See image: test_image.png</p></problem>'
406406
407407 media_type = content_api .get_or_create_media_type ("image/png" )
408- test_content = content_api .get_or_create_file_content (
408+ test_media = content_api .get_or_create_file_media (
409409 self .learning_package .id ,
410410 media_type .id ,
411411 data = b"fake_image_data" ,
412412 created = timezone .now (),
413413 )
414- content_by_filename = {"test_image.png" : test_content .id }
414+ content_by_filename = {"test_image.png" : test_media .id }
415415 context = self ._make_migration_context (content_by_filename = content_by_filename )
416416 result , reason = _migrate_component (
417417 context = context ,
@@ -423,11 +423,11 @@ def test_migrate_component_with_static_content(self):
423423 self .assertIsNotNone (result )
424424 self .assertIsNone (reason )
425425
426- component_content = result .componentversion .componentversioncontent_set .filter (
426+ component_media = result .componentversion .componentversionmedia_set .filter (
427427 key = "static/test_image.png"
428428 ).first ()
429- self .assertIsNotNone (component_content )
430- self .assertEqual (component_content . content_id , test_content .id )
429+ self .assertIsNotNone (component_media )
430+ self .assertEqual (component_media . media . id , test_media .id )
431431
432432 def test_migrate_skip_repeats (self ):
433433 """
@@ -638,13 +638,13 @@ def test_migrate_component_content_filename_not_in_olx(self):
638638 olx = '<problem display_name="Test Problem"><p>See image: referenced.png</p></problem>'
639639
640640 media_type = content_api .get_or_create_media_type ("image/png" )
641- referenced_content = content_api .get_or_create_file_content (
641+ referenced_content = content_api .get_or_create_file_media (
642642 self .learning_package .id ,
643643 media_type .id ,
644644 data = b"referenced_image_data" ,
645645 created = timezone .now (),
646646 )
647- unreferenced_content = content_api .get_or_create_file_content (
647+ unreferenced_content = content_api .get_or_create_file_media (
648648 self .learning_package .id ,
649649 media_type .id ,
650650 data = b"unreferenced_image_data" ,
@@ -670,12 +670,12 @@ def test_migrate_component_content_filename_not_in_olx(self):
670670 self .assertIsNone (reason )
671671
672672 referenced_content_exists = (
673- result .componentversion .componentversioncontent_set .filter (
673+ result .componentversion .componentversionmedia_set .filter (
674674 key = "static/referenced.png"
675675 ).exists ()
676676 )
677677 unreferenced_content_exists = (
678- result .componentversion .componentversioncontent_set .filter (
678+ result .componentversion .componentversionmedia_set .filter (
679679 key = "static/unreferenced.png"
680680 ).exists ()
681681 )
@@ -722,7 +722,7 @@ def test_migrate_container_creates_new_container(self):
722722 )
723723 child_version_1 = content_api .create_next_component_version (
724724 child_component_1 .pk ,
725- content_to_replace = {},
725+ media_to_replace = {},
726726 created = timezone .now (),
727727 created_by = self .user .id ,
728728 )
@@ -738,7 +738,7 @@ def test_migrate_container_creates_new_container(self):
738738 )
739739 child_version_2 = content_api .create_next_component_version (
740740 child_component_2 .pk ,
741- content_to_replace = {},
741+ media_to_replace = {},
742742 created = timezone .now (),
743743 created_by = self .user .id ,
744744 )
@@ -910,7 +910,7 @@ def test_migrate_container_preserves_child_order(self):
910910 )
911911 child_version = content_api .create_next_component_version (
912912 child_component .pk ,
913- content_to_replace = {},
913+ media_to_replace = {},
914914 created = timezone .now (),
915915 created_by = self .user .id ,
916916 )
@@ -950,7 +950,7 @@ def test_migrate_container_with_mixed_child_types(self):
950950 )
951951 problem_version = content_api .create_next_component_version (
952952 problem_component .pk ,
953- content_to_replace = {},
953+ media_to_replace = {},
954954 created = timezone .now (),
955955 created_by = self .user .id ,
956956 )
@@ -966,7 +966,7 @@ def test_migrate_container_with_mixed_child_types(self):
966966 )
967967 html_version = content_api .create_next_component_version (
968968 html_component .pk ,
969- content_to_replace = {},
969+ media_to_replace = {},
970970 created = timezone .now (),
971971 created_by = self .user .id ,
972972 )
@@ -982,7 +982,7 @@ def test_migrate_container_with_mixed_child_types(self):
982982 )
983983 video_version = content_api .create_next_component_version (
984984 video_component .pk ,
985- content_to_replace = {},
985+ media_to_replace = {},
986986 created = timezone .now (),
987987 created_by = self .user .id ,
988988 )
0 commit comments