I am not sure about the specifics of the situation here.
Ideally once the software has done, what is supposed to be tested, a test should just assert the actual state with the expected pre-determined state of the SUT.
As far as calculating pre-determined expected state is concerned ,in our team it is directly hard - coded in tests, copied directly from Use Stories as captured in BDD( Cucumber) framework which act as a communication tool between Business Analyst, Developer & tester.
But NO behind the scene operations in between the test like DB manipulations/ API calls except test data setups/cleanups before & after the test. No re-calculations of business logic inside tests. A big NO.