def test_add_instance_to_scene(self): instances = breakdown_service.get_asset_instances_for_scene( self.scene.id) self.assertEquals(instances, {}) self.new_scene_instance(self.asset_id) self.new_scene_instance(self.asset_id) self.new_scene_instance(self.asset_character_id) instances = breakdown_service.get_asset_instances_for_scene( self.scene.id) self.assertEquals(len(instances[self.asset_id]), 2) self.assertEquals(len(instances[self.asset_character_id]), 1) self.assertEquals(instances[self.asset_id][0]["number"], 1) self.assertEquals(instances[self.asset_id][1]["number"], 2) self.assertEquals(instances[self.asset_character_id][0]["number"], 1)
def get(self, scene_id): """ Retrieve all asset instances linked to scene. """ scene = shots_service.get_scene(scene_id) user_service.check_project_access(scene["project_id"]) return breakdown_service.get_asset_instances_for_scene(scene_id)