Moved some duplicated test methods into a test_utils module