From 6c39b58cb4aee35853348e6525f7dba6b6f29ba6 Mon Sep 17 00:00:00 2001 From: Maarten ter Huurne Date: Fri, 22 Mar 2024 18:43:07 +0100 Subject: [PATCH] Remove `FeaturedManager` and related obsolete test model code The code under test was removed in 6ae66e01, but some of the test code remained. --- tests/models.py | 26 -------------------------- 1 file changed, 26 deletions(-) diff --git a/tests/models.py b/tests/models.py index ef9e67c0..732e24a4 100644 --- a/tests/models.py +++ b/tests/models.py @@ -201,32 +201,6 @@ class NoRendered(models.Model): body = SplitField(no_excerpt_field=True) -class AuthorMixin: - def by_author(self, name): - return self.filter(author=name) - - -class PublishedMixin: - def published(self): - return self.filter(published=True) - - -def unpublished(self): - return self.filter(published=False) - - -class ByAuthorQuerySet(models.query.QuerySet, AuthorMixin): - pass - - -class FeaturedManager(models.Manager): - def get_queryset(self): - kwargs = {} - if hasattr(self, "_db"): - kwargs["using"] = self._db - return ByAuthorQuerySet(self.model, **kwargs).filter(feature=True) - - class AbstractTracked(models.Model): number = 1