fix datetime namespace and improve test