Kaydet (Commit) 406675b1 authored tarafından Tim Graham's avatar Tim Graham

Fixed #26176 -- Fixed E123 flake8 warnings.

üst 27531451
...@@ -5,12 +5,16 @@ from django.utils.translation import ugettext, ugettext_lazy as _ ...@@ -5,12 +5,16 @@ from django.utils.translation import ugettext, ugettext_lazy as _
class FlatpageForm(forms.ModelForm): class FlatpageForm(forms.ModelForm):
url = forms.RegexField(label=_("URL"), max_length=100, regex=r'^[-\w/\.~]+$', url = forms.RegexField(
help_text=_("Example: '/about/contact/'. Make sure to have leading" label=_("URL"),
" and trailing slashes."), max_length=100,
regex=r'^[-\w/\.~]+$',
help_text=_("Example: '/about/contact/'. Make sure to have leading and trailing slashes."),
error_messages={ error_messages={
"invalid": _("This value must contain only letters, numbers," "invalid": _(
" dots, underscores, dashes, slashes or tildes."), "This value must contain only letters, numbers, dots, "
"underscores, dashes, slashes or tildes."
),
}, },
) )
......
...@@ -13,7 +13,10 @@ class FlatPage(models.Model): ...@@ -13,7 +13,10 @@ class FlatPage(models.Model):
title = models.CharField(_('title'), max_length=200) title = models.CharField(_('title'), max_length=200)
content = models.TextField(_('content'), blank=True) content = models.TextField(_('content'), blank=True)
enable_comments = models.BooleanField(_('enable comments'), default=False) enable_comments = models.BooleanField(_('enable comments'), default=False)
template_name = models.CharField(_('template name'), max_length=70, blank=True, template_name = models.CharField(
_('template name'),
max_length=70,
blank=True,
help_text=_( help_text=_(
"Example: 'flatpages/contact_page.html'. If this isn't provided, " "Example: 'flatpages/contact_page.html'. If this isn't provided, "
"the system will use 'flatpages/default.html'." "the system will use 'flatpages/default.html'."
......
...@@ -62,7 +62,8 @@ get_band_ds = voidptr_output(std_call('GDALGetBandDataset'), [c_void_p]) ...@@ -62,7 +62,8 @@ get_band_ds = voidptr_output(std_call('GDALGetBandDataset'), [c_void_p])
get_band_datatype = int_output(std_call('GDALGetRasterDataType'), [c_void_p]) get_band_datatype = int_output(std_call('GDALGetRasterDataType'), [c_void_p])
get_band_nodata_value = double_output(std_call('GDALGetRasterNoDataValue'), [c_void_p, POINTER(c_int)]) get_band_nodata_value = double_output(std_call('GDALGetRasterNoDataValue'), [c_void_p, POINTER(c_int)])
set_band_nodata_value = void_output(std_call('GDALSetRasterNoDataValue'), [c_void_p, c_double]) set_band_nodata_value = void_output(std_call('GDALSetRasterNoDataValue'), [c_void_p, c_double])
get_band_statistics = void_output(std_call('GDALGetRasterStatistics'), get_band_statistics = void_output(
std_call('GDALGetRasterStatistics'),
[ [
c_void_p, c_int, c_int, POINTER(c_double), POINTER(c_double), c_void_p, c_int, c_int, POINTER(c_double), POINTER(c_double),
POINTER(c_double), POINTER(c_double), c_void_p, c_void_p, POINTER(c_double), POINTER(c_double), c_void_p, c_void_p,
......
...@@ -658,11 +658,11 @@ class BaseDateDetailView(YearMixin, MonthMixin, DayMixin, DateMixin, BaseDetailV ...@@ -658,11 +658,11 @@ class BaseDateDetailView(YearMixin, MonthMixin, DayMixin, DateMixin, BaseDetailV
if not self.get_allow_future() and date > datetime.date.today(): if not self.get_allow_future() and date > datetime.date.today():
raise Http404(_( raise Http404(_(
"Future %(verbose_name_plural)s not available because " "Future %(verbose_name_plural)s not available because "
"%(class_name)s.allow_future is False.") % { "%(class_name)s.allow_future is False."
) % {
'verbose_name_plural': qs.model._meta.verbose_name_plural, 'verbose_name_plural': qs.model._meta.verbose_name_plural,
'class_name': self.__class__.__name__, 'class_name': self.__class__.__name__,
}, })
)
# Filter down a queryset from self.queryset using the date from the # Filter down a queryset from self.queryset using the date from the
# URL. This'll get passed as the queryset to DetailView.get_object, # URL. This'll get passed as the queryset to DetailView.get_object,
......
...@@ -4,7 +4,7 @@ install-script = scripts/rpm-install.sh ...@@ -4,7 +4,7 @@ install-script = scripts/rpm-install.sh
[flake8] [flake8]
exclude = build,.git,./django/utils/lru_cache.py,./django/utils/six.py,./django/conf/app_template/*,./django/dispatch/weakref_backports.py,./tests/.env,./xmlrunner,tests/view_tests/tests/py3_test_debug.py,tests/template_tests/annotated_tag_function.py exclude = build,.git,./django/utils/lru_cache.py,./django/utils/six.py,./django/conf/app_template/*,./django/dispatch/weakref_backports.py,./tests/.env,./xmlrunner,tests/view_tests/tests/py3_test_debug.py,tests/template_tests/annotated_tag_function.py
ignore = E123,E128,E402,W503,W601 ignore = E128,E402,W503,W601
max-line-length = 119 max-line-length = 119
[isort] [isort]
......
...@@ -428,7 +428,8 @@ class NonAggregateAnnotationTestCase(TestCase): ...@@ -428,7 +428,8 @@ class NonAggregateAnnotationTestCase(TestCase):
F('ticker_name'), F('ticker_name'),
F('description'), F('description'),
Value('No Tag'), Value('No Tag'),
function='COALESCE') function='COALESCE'
)
).order_by('name') ).order_by('name')
self.assertQuerysetEqual( self.assertQuerysetEqual(
......
...@@ -56,10 +56,9 @@ class MigrateTests(TransactionTestCase): ...@@ -56,10 +56,9 @@ class MigrateTests(TransactionTestCase):
# Not all GIS backends have geometry columns model # Not all GIS backends have geometry columns model
pass pass
else: else:
self.assertEqual( qs = GeoColumn.objects.filter(
GeoColumn.objects.filter(
**{'%s__in' % GeoColumn.table_name_col(): ["gis_neighborhood", "gis_household"]} **{'%s__in' % GeoColumn.table_name_col(): ["gis_neighborhood", "gis_household"]}
).count(), )
0) self.assertEqual(qs.count(), 0)
# Revert the "unmigration" # Revert the "unmigration"
call_command("migrate", "gis_migrations", verbosity=0) call_command("migrate", "gis_migrations", verbosity=0)
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
...@@ -86,10 +86,7 @@ class SecurityMiddlewareTest(SimpleTestCase): ...@@ -86,10 +86,7 @@ class SecurityMiddlewareTest(SimpleTestCase):
"includeSubDomains" tag to the response. "includeSubDomains" tag to the response.
""" """
response = self.process_response(secure=True) response = self.process_response(secure=True)
self.assertEqual( self.assertEqual(response["strict-transport-security"], "max-age=600; includeSubDomains")
response["strict-transport-security"],
"max-age=600; includeSubDomains",
)
@override_settings( @override_settings(
SECURE_HSTS_SECONDS=600, SECURE_HSTS_INCLUDE_SUBDOMAINS=False) SECURE_HSTS_SECONDS=600, SECURE_HSTS_INCLUDE_SUBDOMAINS=False)
......
...@@ -270,7 +270,8 @@ class TemplateResponseTest(SimpleTestCase): ...@@ -270,7 +270,8 @@ class TemplateResponseTest(SimpleTestCase):
def test_pickling(self): def test_pickling(self):
# Create a template response. The context is # Create a template response. The context is
# known to be unpicklable (e.g., a function). # known to be unpicklable (e.g., a function).
response = TemplateResponse(self.factory.get('/'), response = TemplateResponse(
self.factory.get('/'),
'first/test.html', { 'first/test.html', {
'value': 123, 'value': 123,
'fn': datetime.now, 'fn': datetime.now,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment