Fixed registered field having wrong timezone
This happened with at least Postgres, which took it's server's timezone. It's complicated. Let's just set it from our side instead where we have some control.
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
"""Integration tests for the Spool API endpoint."""
|
||||
|
||||
from datetime import datetime, timezone
|
||||
from typing import Any
|
||||
|
||||
import httpx
|
||||
@@ -63,6 +64,10 @@ def test_add_spool_remaining_weight(random_filament: dict[str, Any]):
|
||||
"archived": archived,
|
||||
}
|
||||
|
||||
# Verify that registered happened almost now (within 1 minute)
|
||||
diff = abs((datetime.now(tz=timezone.utc) - datetime.fromisoformat(spool["registered"])).total_seconds())
|
||||
assert diff < 60
|
||||
|
||||
# Clean up
|
||||
httpx.delete(f"{URL}/api/v1/spool/{spool['id']}").raise_for_status()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user