Workaround for Python < 3.4 in test_templating.

This workaround avoids some race condition. Python < 3.4 has unsorted
test.