Fixed some flake8 issues

This commit is contained in:
Alex Gaynor 2013-11-22 09:10:18 -08:00
parent 9f8810ac51
commit b9d908da54
3 changed files with 3 additions and 3 deletions

View File

@ -156,6 +156,7 @@ class TestRelatedFieldsAdminOrdering(TestCase):
if db_field.name == 'band': if db_field.name == 'band':
kwargs["queryset"] = Band.objects.filter(rank__gt=2) kwargs["queryset"] = Band.objects.filter(rank__gt=2)
return super(SongAdmin, self).formfield_for_foreignkey(db_field, **kwargs) return super(SongAdmin, self).formfield_for_foreignkey(db_field, **kwargs)
def formfield_for_manytomany(self, db_field, **kwargs): def formfield_for_manytomany(self, db_field, **kwargs):
if db_field.name == 'other_interpreters': if db_field.name == 'other_interpreters':
kwargs["queryset"] = Band.objects.filter(rank__gt=2) kwargs["queryset"] = Band.objects.filter(rank__gt=2)

View File

@ -21,8 +21,7 @@ from django.core.cache.backends.base import (CacheKeyWarning,
InvalidCacheBackendError) InvalidCacheBackendError)
from django.db import connection, router, transaction from django.db import connection, router, transaction
from django.core.cache.utils import make_template_fragment_key from django.core.cache.utils import make_template_fragment_key
from django.http import (HttpResponse, HttpRequest, StreamingHttpResponse, from django.http import HttpResponse, StreamingHttpResponse
QueryDict)
from django.middleware.cache import (FetchFromCacheMiddleware, from django.middleware.cache import (FetchFromCacheMiddleware,
UpdateCacheMiddleware, CacheMiddleware) UpdateCacheMiddleware, CacheMiddleware)
from django.template import Template from django.template import Template

View File

@ -162,7 +162,7 @@ class InlineFormsetFactoryTest(TestCase):
def test_zero_primary_key(self): def test_zero_primary_key(self):
# Regression test for #21472 # Regression test for #21472
poet = Poet.objects.create(id=0, name='test') 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) PoemFormSet = inlineformset_factory(Poet, Poem, fields="__all__", extra=0)
formset = PoemFormSet(None, instance=poet) formset = PoemFormSet(None, instance=poet)
self.assertEqual(len(formset.forms), 1) self.assertEqual(len(formset.forms), 1)