Unittests: Make sure layer tests pass with or without workspace

This commit is contained in:
Dalai Felinto
2017-07-17 12:14:02 +02:00
parent 36977a962b
commit a258c5d325
15 changed files with 18 additions and 0 deletions

View File

@@ -88,6 +88,10 @@ class UnitTesting(RenderLayerTesting):
layer.collections.active_index = 3
self.assertEqual(layer.collections.active.name, 'scorpion')
# Change active scene layer (do it for workspace too just to don't get mangled in workspace bugs)
scene = bpy.context.scene
scene.render_layers.active_index = len(scene.render_layers) - 2
self.assertEqual(scene.render_layers.active.name, "Viewport")
bpy.context.workspace.render_layer = bpy.context.scene.render_layers['Viewport']
# old layer