Skip to content

Commit

Permalink
[IMP] extendable_fastapi: Add class to ease tests with fastapi and ex…
Browse files Browse the repository at this point in the history
…tendable
  • Loading branch information
lmignon committed Jun 26, 2023
1 parent fdc7cc3 commit af9fff5
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 0 deletions.
Empty file.
21 changes: 21 additions & 0 deletions extendable_fastapi/tests/common.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Copyright 2023 ACSONE SA/NV
# License LGPL-3.0 or later (http://www.gnu.org/licenses/LGPL).

from odoo.addons.extendable.tests.common import ExtendableMixin
from odoo.addons.fastapi.tests.common import (
FastAPITransactionCase as BaseFastAPITransactionCase,
)


class FastAPITransactionCase(BaseFastAPITransactionCase, ExtendableMixin):
"""Base class for FastAPI tests using extendable classes."""

@classmethod
def setUpClass(cls) -> None:
super().setUpClass()
cls.init_extendable_registry()

@classmethod
def tearDownClass(cls) -> None:
super().tearDownClass()
cls.reset_extendable_registry()

0 comments on commit af9fff5

Please sign in to comment.