Fix tests to check datetime objects.