Chore: make the backend test suite pass on PostgreSQL

Remove SQLite-only assumptions from the tests: hard-coded primary keys,
NULL ordering, the database vendor, and the CPU-dependent default process
count. Keep the test connection open inside the test transaction, since
close_old_connections() and connections.close_all() really close it on
PostgreSQL.
This commit is contained in:
stumpylog committed 2026-10-30 12:55:37 -07:00
1 parent 80a1827fa0
commit 5be95f8fcc
13 files changed
+121 -79

No files matched your search

+2 -1
View File
@@ -5,6 +5,7 @@ from datetime import timedelta
from pathlib import Path
from unittest import mock
from django.db import connection
from django.test import override_settings
from django.utils import timezone
from rest_framework import status
@@ -68,7 +69,7 @@ class TestSystemStatus(APITestCase):
self.assertEqual(response.data["install_type"], "bare-metal")
self.assertIsNotNone(response.data["storage"]["total"])
self.assertIsNotNone(response.data["storage"]["available"])
self.assertEqual(response.data["database"]["type"], "sqlite")
self.assertEqual(response.data["database"]["type"], connection.vendor)
self.assertIsNotNone(response.data["database"]["url"])
self.assertEqual(response.data["database"]["status"], "OK")
self.assertIsNone(response.data["database"]["error"])