Hack: use helper functions in tests for less copy-pasting
rebase master
Merge pull request #1204 from dotcloud/tests-less-copypaste

Hack: use helper functions in tests for less copy-pasting