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`.
This commit is contained in:
Maarten ter Huurne 2024-04-16 03:14:11 +02:00
parent 68a4c14c74
commit 800961626a
2 changed files with 6 additions and 7 deletions

View file

@ -1,6 +0,0 @@
from model_utils.managers import SoftDeletableQuerySet
class CustomSoftDeleteQuerySet(SoftDeletableQuerySet):
def only_read(self):
return self.filter(is_read=True)

View file

@ -14,6 +14,7 @@ from model_utils.managers import (
JoinManager,
QueryManager,
SoftDeletableManager,
SoftDeletableQuerySet,
)
from model_utils.models import (
SoftDeletableModel,
@ -24,7 +25,6 @@ from model_utils.models import (
)
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)