This is a great example of where we could/should be using the code in my other pull request, where I have some functions in testutils that abstract away most of this code...