diff --git a/tests/admin_ordering/tests.py b/tests/admin_ordering/tests.py index 0d62951e75..acd1a5ccdb 100644 --- a/tests/admin_ordering/tests.py +++ b/tests/admin_ordering/tests.py @@ -156,6 +156,7 @@ class TestRelatedFieldsAdminOrdering(TestCase): if db_field.name == 'band': kwargs["queryset"] = Band.objects.filter(rank__gt=2) return super(SongAdmin, self).formfield_for_foreignkey(db_field, **kwargs) + def formfield_for_manytomany(self, db_field, **kwargs): if db_field.name == 'other_interpreters': kwargs["queryset"] = Band.objects.filter(rank__gt=2) diff --git a/tests/cache/tests.py b/tests/cache/tests.py index 053face8a1..85e65168af 100644 --- a/tests/cache/tests.py +++ b/tests/cache/tests.py @@ -21,8 +21,7 @@ from django.core.cache.backends.base import (CacheKeyWarning, InvalidCacheBackendError) from django.db import connection, router, transaction from django.core.cache.utils import make_template_fragment_key -from django.http import (HttpResponse, HttpRequest, StreamingHttpResponse, - QueryDict) +from django.http import HttpResponse, StreamingHttpResponse from django.middleware.cache import (FetchFromCacheMiddleware, UpdateCacheMiddleware, CacheMiddleware) from django.template import Template diff --git a/tests/inline_formsets/tests.py b/tests/inline_formsets/tests.py index 5258907919..707115878f 100644 --- a/tests/inline_formsets/tests.py +++ b/tests/inline_formsets/tests.py @@ -162,7 +162,7 @@ class InlineFormsetFactoryTest(TestCase): def test_zero_primary_key(self): # Regression test for #21472 poet = Poet.objects.create(id=0, name='test') - poem = poet.poem_set.create(name='test poem') + poet.poem_set.create(name='test poem') PoemFormSet = inlineformset_factory(Poet, Poem, fields="__all__", extra=0) formset = PoemFormSet(None, instance=poet) self.assertEqual(len(formset.forms), 1)