From: Michael Tremer Date: Wed, 12 Oct 2022 16:23:33 +0000 (+0000) Subject: tests: Create default objects in a single database transaction X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1dede36aae73af423cee764b9b8753e22a41dae8;p=pbs.git tests: Create default objects in a single database transaction Signed-off-by: Michael Tremer --- diff --git a/tests/test.py b/tests/test.py index ebab1b43..bca98317 100644 --- a/tests/test.py +++ b/tests/test.py @@ -93,7 +93,8 @@ class TestCase(unittest.IsolatedAsyncioTestCase): self.db = self.backend.db # Create some default objects - await self._create_default_objects() + with self.db.transaction(): + await self._create_default_objects() async def asyncTearDown(self): # Dump a listing of all temporary files