Issue #19605: Use specific asserts in datetime tests