@@ -766,38 +766,25 @@ def setUp(self):
766766
767767 # Create XBlocks
768768 # Create some library blocks in lib1
769- self .problem_block_dict = self ._add_block_to_library (
769+ self .problem_block = self ._add_block_to_library (
770770 self .lib1 .library_key , "problem" , "problem1" ,
771771 )
772- self .problem_block_usage_key = UsageKey .from_string (self .problem_block_dict ["id" ])
773- self .html_block_dict = self ._add_block_to_library (
772+ self .problem_block_usage_key = UsageKey .from_string (self .problem_block ["id" ])
773+ self .html_block = self ._add_block_to_library (
774774 self .lib1 .library_key , "html" , "html1" ,
775775 )
776- self .html_block_usage_key = UsageKey .from_string (self .html_block_dict ["id" ])
777- now = datetime .now (tz = timezone .utc )
776+ self .html_block_usage_key = UsageKey .from_string (self .html_block ["id" ])
778777
779778 # Add content to units
780- # TODO build API for this
781- self .problem_block_component = api .get_component_from_usage_key (self .problem_block_usage_key )
782- self .html_block_component = api .get_component_from_usage_key (self .html_block_usage_key )
783- authoring_api .create_next_container_version (
784- self .unit1 .container_pk ,
785- publishable_entities_pks = [
786- self .problem_block_component .publishable_entity .id ,
787- self .html_block_component .publishable_entity .id ,
788- ],
789- title = None ,
790- entity_version_pks = None ,
791- created = now ,
792- created_by = None ,
793- )
794- authoring_api .create_next_container_version (
795- self .unit2 .container_pk ,
796- publishable_entities_pks = [self .html_block_component .publishable_entity .id ],
797- title = None ,
798- entity_version_pks = None ,
799- created = now ,
800- created_by = None ,
779+ api .update_container_children (
780+ self .unit1 .container_key ,
781+ [self .problem_block_usage_key , self .html_block_usage_key ],
782+ None ,
783+ )
784+ api .update_container_children (
785+ self .unit2 .container_key ,
786+ [self .html_block_usage_key ],
787+ None ,
801788 )
802789
803790 def test_get_containers_contains_component (self ):
0 commit comments