That's the correct way to use DoesNotExist.