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:
6
tests_integration/tests/vendor/test_add.py
vendored
6
tests_integration/tests/vendor/test_add.py
vendored
@@ -1,5 +1,7 @@
|
||||
"""Integration tests for the Vendor API endpoint."""
|
||||
|
||||
from datetime import datetime, timezone
|
||||
|
||||
import httpx
|
||||
|
||||
URL = "http://spoolman:8000"
|
||||
@@ -25,6 +27,10 @@ def test_add_vendor():
|
||||
"comment": comment,
|
||||
}
|
||||
|
||||
# Verify that registered happened almost now (within 1 minute)
|
||||
diff = abs((datetime.now(tz=timezone.utc) - datetime.fromisoformat(vendor["registered"])).total_seconds())
|
||||
assert diff < 60
|
||||
|
||||
# Clean up
|
||||
httpx.delete(f"{URL}/api/v1/vendor/{vendor['id']}").raise_for_status()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user