refactor entity delete logic in test