Affiliates tests refactoring