From 14ac0b4f3ac3f0ef7f21458b7fdbb0f88ce20456 Mon Sep 17 00:00:00 2001 From: Maarten ter Huurne Date: Tue, 16 Apr 2024 03:14:11 +0200 Subject: [PATCH] Move `CustomSoftDeleteQuerySet` to `tests.models` The `CustomSoftDeleteQuerySet` class was the only code left in the `test.managers` module, while it is not in fact a `Manager`. --- tests/managers.py | 6 ------ tests/models.py | 7 ++++++- 2 files changed, 6 insertions(+), 7 deletions(-) delete mode 100644 tests/managers.py diff --git a/tests/managers.py b/tests/managers.py deleted file mode 100644 index 640420cb..00000000 --- a/tests/managers.py +++ /dev/null @@ -1,6 +0,0 @@ -from model_utils.managers import SoftDeletableQuerySet - - -class CustomSoftDeleteQuerySet(SoftDeletableQuerySet): - def only_read(self): - return self.filter(is_read=True) diff --git a/tests/models.py b/tests/models.py index b5b4f37c..442200f2 100644 --- a/tests/models.py +++ b/tests/models.py @@ -14,6 +14,7 @@ JoinManager, QueryManager, SoftDeletableManager, + SoftDeletableQuerySet, ) from model_utils.models import ( SoftDeletableModel, @@ -24,7 +25,6 @@ ) from model_utils.tracker import FieldTracker, ModelTracker from tests.fields import MutableField -from tests.managers import CustomSoftDeleteQuerySet class InheritanceManagerTestRelated(models.Model): @@ -352,6 +352,11 @@ class SoftDeletable(SoftDeletableModel): all_objects: ClassVar[Manager[SoftDeletable]] = models.Manager() +class CustomSoftDeleteQuerySet(SoftDeletableQuerySet): + def only_read(self): + return self.filter(is_read=True) + + class CustomSoftDelete(SoftDeletableModel): is_read = models.BooleanField(default=False)