diff --git a/tests/test_api_long.py b/tests/test_api_long.py index 8f9ccc872..2938a28a1 100644 --- a/tests/test_api_long.py +++ b/tests/test_api_long.py @@ -4,6 +4,7 @@ """ import base +import random class TestShotgunApiLong(base.LiveTestBase): @@ -70,10 +71,21 @@ def test_schema(self): self.assertTrue(schema, dict) self.assertTrue(len(schema) > 0) self.assertTrue("user" in schema) + + # An explantion is in order here. the field code that is created in shotgun is based on the human display name + # that is provided , so for example "Money Count" would generate the field code 'sg_monkey_count' . The field + # that is created in this test is retired at the end of the test but when this test is run again against + # the same database ( which happens on our Continous Integration server ) trying to create a new field + # called "Monkey Count" will now fail due to the new Delete Field Forever features we have added to shotgun + # since there will a retired field called sg_monkey_count. The old behavior was to go ahead and create a new + # "Monkey Count" field with a field code with an incremented number of the end like sg_monkey_count_1. The new + # behavior is to raise an error in hopes the user will go into the UI and delete the old retired field forever. + + # make a the name of the field somewhat unique + human_field_name = "Monkey " + str(random.getrandbits(24)) properties = { "description" : "How many monkeys were needed" } - new_field_name = self.sg.schema_field_create("Version", "number", - "Monkey Count", + new_field_name = self.sg.schema_field_create("Version", "number", human_field_name, properties=properties) properties = {"description" : "How many monkeys turned up"}