Skip to content

Commit

Permalink
Move CustomSoftDeleteQuerySet to tests.models
Browse files Browse the repository at this point in the history
The `CustomSoftDeleteQuerySet` class was the only code left in
the `test.managers` module, while it is not in fact a `Manager`.
  • Loading branch information
mthuurne committed Apr 16, 2024
1 parent 600d59c commit 14ac0b4
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
6 changes: 0 additions & 6 deletions tests/managers.py

This file was deleted.

7 changes: 6 additions & 1 deletion tests/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
JoinManager,
QueryManager,
SoftDeletableManager,
SoftDeletableQuerySet,
)
from model_utils.models import (
SoftDeletableModel,
Expand All @@ -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):
Expand Down Expand Up @@ -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)

Expand Down

0 comments on commit 14ac0b4

Please sign in to comment.