Adding test helper functions

I thought these two functions might help reduce duplication in our tests since we seem to be performing the same logic over and over again. This PR is just a RFC, so if it's something we want, I'll go ahead and update our tests to use it :smile: 
:+1: good idea