unittests: Update (fix) unittests after workspace API change

Tests were broken since e8c15e0ed1.

We now get view_layer from window, not workspace, since the same workspace can
have a different view_layer depending on the window scene.
This commit is contained in:
Dalai Felinto
2017-12-01 16:08:45 -02:00
parent e9cf3fae8e
commit aa0c9867b2
15 changed files with 27 additions and 27 deletions

View File

@@ -21,13 +21,13 @@ class UnitTesting(ViewLayerTesting):
import bpy
scene = bpy.context.scene
workspace = bpy.context.workspace
window = bpy.context.window
cube = bpy.data.objects.new('guinea pig', bpy.data.meshes.new('mesh'))
layer = scene.view_layers.new('Selectability Test')
layer.collections.unlink(layer.collections[0])
scene.view_layers.active = layer
workspace.view_layer = layer
window.view_layer = layer
scene_collection_mom = scene.master_collection.collections.new("Mom")
scene_collection_kid = scene_collection_mom.collections.new("Kid")