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

@@ -42,7 +42,7 @@ class UnitTesting(ViewLayerTesting):
layer.collections.link(subzero)
scene.view_layers.active_index = len(scene.view_layers) - 1
bpy.context.workspace.view_layer = bpy.context.scene.view_layers['Fresh new Layer']
bpy.context.window.view_layer = bpy.context.scene.view_layers['Fresh new Layer']
if mode == 'DUPLICATE':
# assuming the latest layer is the active layer