fix testmode bug

Fixes https://trello.com/c/EgW3usAa/191-bug-testmode-doi-generation.