Fix datetime localization in tests.