File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 44"""
55
66import base
7+ import random
78
89class TestShotgunApiLong (base .LiveTestBase ):
910
@@ -70,10 +71,21 @@ def test_schema(self):
7071 self .assertTrue (schema , dict )
7172 self .assertTrue (len (schema ) > 0 )
7273 self .assertTrue ("user" in schema )
74+
75+ # An explantion is in order here. the field code that is created in shotgun is based on the human display name
76+ # that is provided , so for example "Money Count" would generate the field code 'sg_monkey_count' . The field
77+ # that is created in this test is retired at the end of the test but when this test is run again against
78+ # the same database ( which happens on our Continous Integration server ) trying to create a new field
79+ # called "Monkey Count" will now fail due to the new Delete Field Forever features we have added to shotgun
80+ # since there will a retired field called sg_monkey_count. The old behavior was to go ahead and create a new
81+ # "Monkey Count" field with a field code with an incremented number of the end like sg_monkey_count_1. The new
82+ # behavior is to raise an error in hopes the user will go into the UI and delete the old retired field forever.
83+
84+ # make a the name of the field somewhat unique
85+ human_field_name = "Monkey " + str (random .getrandbits (24 ))
7386
7487 properties = { "description" : "How many monkeys were needed" }
75- new_field_name = self .sg .schema_field_create ("Version" , "number" ,
76- "Monkey Count" ,
88+ new_field_name = self .sg .schema_field_create ("Version" , "number" , human_field_name ,
7789 properties = properties )
7890
7991 properties = {"description" : "How many monkeys turned up" }
You can’t perform that action at this time.
0 commit comments