Fix ticket 23699 Migrate in unittest still loads initial data

Fixed #23699 Migrate in unittest still loads initial data
Why the changes in this file?