Where are these rows created?

This should not rely on a specific prepop - and especially not on a particular order of records!

Make sure you create the respective records *right here* within this test case, and remove them afterwards (rollback).

This is a general recommendation for unit tests - define a setUp() or setUpClass() function which creates the records (you can even import files and Solr-index them here - you don't need to call any onaccept or something, just hardcode all necessary steps to create the data), and a tearDown()/tearDownClass() function to remove them afterwards.

For quick drafting up of unit tests, prepop data are ok - but eventually all data you're testing against should be created by the unit test itself.