|
6 | 6 |
|
7 | 7 | from ksef_client.clients.auth import AsyncAuthClient, AuthClient |
8 | 8 | from ksef_client.clients.certificates import AsyncCertificatesClient, CertificatesClient |
9 | | -from ksef_client.clients.invoices import AsyncInvoicesClient, InvoicesClient |
| 9 | +from ksef_client.clients.invoices import ( |
| 10 | + AsyncInvoicesClient, |
| 11 | + InvoicesClient, |
| 12 | + _normalize_datetime_without_offset, |
| 13 | +) |
10 | 14 | from ksef_client.clients.limits import AsyncLimitsClient, LimitsClient |
11 | 15 | from ksef_client.clients.peppol import AsyncPeppolClient, PeppolClient |
12 | 16 | from ksef_client.clients.permissions import AsyncPermissionsClient, PermissionsClient |
@@ -170,6 +174,17 @@ def test_invoices_client(self): |
170 | 174 | "2025-07-02T11:15:00+02:00", |
171 | 175 | ) |
172 | 176 |
|
| 177 | + def test_normalize_datetime_without_offset_passthrough_branches(self): |
| 178 | + self.assertEqual(_normalize_datetime_without_offset("2025-01-02"), "2025-01-02") |
| 179 | + |
| 180 | + invalid_value = "not-a-dateT10:15:00" |
| 181 | + self.assertEqual(_normalize_datetime_without_offset(invalid_value), invalid_value) |
| 182 | + |
| 183 | + tz_aware_short_offset = "2025-01-02T10:15:00+01" |
| 184 | + self.assertEqual( |
| 185 | + _normalize_datetime_without_offset(tz_aware_short_offset), tz_aware_short_offset |
| 186 | + ) |
| 187 | + |
173 | 188 | def test_permissions_client(self): |
174 | 189 | client = PermissionsClient(self.http) |
175 | 190 | with patch.object(client, "_request_json", Mock(return_value={"ok": True})): |
|
0 commit comments