MDL-42318 coursecat: in unittests re-request category from DB after generating courses