chore(base): Dont reload model, reset the parts that change in tests

creates issues with mocking

ref: #788
This commit is contained in:
2025-06-05 14:07:37 +09:30
parent c64add9ce7
commit b1530b3c19
2 changed files with 12 additions and 6 deletions

View File

@ -99,7 +99,7 @@ class CenturionModel(
if keep_parents is None:
keep_parents = self._is_submodel
if self._audit_enabled and self.id:
if self._audit_enabled:
self._after = {}

View File

@ -1,16 +1,22 @@
import pytest
import sys
from importlib import reload
from access.models.tenancy_abstract import TenancyAbstractModel
@pytest.fixture( scope = 'class')
def model_tenancyabstract():
reload( sys.modules[TenancyAbstractModel.__module__] )
def clean_model():
the_model = TenancyAbstractModel
the_model.context = {
'logger': None,
'user': None,
}
return the_model
yield clean_model()
yield TenancyAbstractModel
@pytest.fixture( scope = 'class')