File tree 1 file changed +14
-2
lines changed 1 file changed +14
-2
lines changed Original file line number Diff line number Diff line change 4
4
"""
5
5
6
6
import base
7
+ import random
7
8
8
9
class TestShotgunApiLong (base .LiveTestBase ):
9
10
@@ -70,10 +71,21 @@ def test_schema(self):
70
71
self .assertTrue (schema , dict )
71
72
self .assertTrue (len (schema ) > 0 )
72
73
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 ))
73
86
74
87
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 ,
77
89
properties = properties )
78
90
79
91
properties = {"description" : "How many monkeys turned up" }
You can’t perform that action at this time.
0 commit comments