Use tenant code as a part of primary key. Fix test cases