5
5
from infrahub .database import InfrahubDatabase
6
6
from infrahub .lock_getter import (
7
7
_get_kinds_to_lock_on_object_mutation ,
8
+ _hash ,
8
9
_should_kind_be_locked_on_any_branch ,
9
10
get_lock_names_on_object_mutation ,
10
11
)
@@ -78,7 +79,7 @@ async def test_lock_names_only_attributes(
78
79
person = await create_and_save (db = db , schema = "TestPerson" , name = "John" )
79
80
car = await create_and_save (db = db , schema = "TestCar" , name = "mercedes" , color = "blue" , owner = person )
80
81
assert get_lock_names_on_object_mutation (car , branch = default_branch , schema_branch = schema_branch ) == [
81
- "global.object.TestCar." + str ( hash ( "mercedes" )) + "." + str ( hash ( "blue" ) )
82
+ "global.object.TestCar." + _hash ( "mercedes" ) + "." + _hash ( "blue" )
82
83
]
83
84
84
85
async def test_lock_names_optional_empty_attribute (
@@ -95,5 +96,5 @@ async def test_lock_names_optional_empty_attribute(
95
96
schema_branch = registry .schema .get_schema_branch (name = default_branch .name )
96
97
person = await create_and_save (db = db , schema = "TestPerson" , name = "John" )
97
98
assert get_lock_names_on_object_mutation (person , branch = default_branch , schema_branch = schema_branch ) == [
98
- "global.object.TestPerson." + str ( hash ( "" )) + "." + str ( hash ( "John" ) )
99
+ "global.object.TestPerson." + _hash ( "" ) + "." + _hash ( "John" )
99
100
]
0 commit comments