TST: change tests for remove_unnecessary_updates
Replaced three test functions that were testing remove_unnecessary_updates
with a new one that calls that function directly.
Changed remove_unnecessary_updates
such that no retrieve occurs within the function. This reduces the complexity.