1
0
mirror of https://github.com/django/django.git synced 2025-10-31 09:41:08 +00:00

[1.8.x] Fixed E265 comment style

Backport of db77915c9f from master
This commit is contained in:
Collin Anderson
2015-02-05 13:25:34 -05:00
committed by Tim Graham
parent 232a1d297c
commit fc8e1e0c10
54 changed files with 197 additions and 210 deletions

View File

@@ -464,7 +464,7 @@ class EscapingChecks(TestCase):
@unittest.skipUnless(connection.vendor == 'sqlite',
"This is an sqlite-specific issue")
def test_sqlite_parameter_escaping(self):
#13648: '%s' escaping support for sqlite3
# '%s' escaping support for sqlite3 #13648
cursor = connection.cursor()
cursor.execute("select strftime('%s', date('now'))")
response = cursor.fetchall()[0][0]
@@ -502,7 +502,7 @@ class BackendTestCase(TransactionTestCase):
cursor.execute(query, args)
def test_cursor_executemany(self):
#4896: Test cursor.executemany
# Test cursor.executemany #4896
args = [(i, i ** 2) for i in range(-5, 6)]
self.create_squares_with_executemany(args)
self.assertEqual(models.Square.objects.count(), 11)
@@ -511,13 +511,13 @@ class BackendTestCase(TransactionTestCase):
self.assertEqual(square.square, i ** 2)
def test_cursor_executemany_with_empty_params_list(self):
#4765: executemany with params=[] does nothing
# Test executemany with params=[] does nothing #4765
args = []
self.create_squares_with_executemany(args)
self.assertEqual(models.Square.objects.count(), 0)
def test_cursor_executemany_with_iterator(self):
#10320: executemany accepts iterators
# Test executemany accepts iterators #10320
args = iter((i, i ** 2) for i in range(-3, 2))
self.create_squares_with_executemany(args)
self.assertEqual(models.Square.objects.count(), 5)
@@ -530,14 +530,14 @@ class BackendTestCase(TransactionTestCase):
@skipUnlessDBFeature('supports_paramstyle_pyformat')
def test_cursor_execute_with_pyformat(self):
#10070: Support pyformat style passing of parameters
# Support pyformat style passing of parameters #10070
args = {'root': 3, 'square': 9}
self.create_squares(args, 'pyformat', multiple=False)
self.assertEqual(models.Square.objects.count(), 1)
@skipUnlessDBFeature('supports_paramstyle_pyformat')
def test_cursor_executemany_with_pyformat(self):
#10070: Support pyformat style passing of parameters
# Support pyformat style passing of parameters #10070
args = [{'root': i, 'square': i ** 2} for i in range(-5, 6)]
self.create_squares(args, 'pyformat', multiple=True)
self.assertEqual(models.Square.objects.count(), 11)
@@ -558,7 +558,7 @@ class BackendTestCase(TransactionTestCase):
self.assertEqual(models.Square.objects.count(), 9)
def test_unicode_fetches(self):
#6254: fetchone, fetchmany, fetchall return strings as unicode objects
# fetchone, fetchmany, fetchall return strings as unicode objects #6254
qn = connection.ops.quote_name
models.Person(first_name="John", last_name="Doe").save()
models.Person(first_name="Jane", last_name="Doe").save()

View File

@@ -345,7 +345,7 @@ class HttpResponseTests(unittest.TestCase):
# test odd inputs
r = HttpResponse()
r.content = ['1', '2', 3, '\u079e']
#'\xde\x9e' == unichr(1950).encode('utf-8')
# '\xde\x9e' == unichr(1950).encode('utf-8')
self.assertEqual(r.content, b'123\xde\x9e')
# .content can safely be accessed multiple times.

View File

@@ -30,7 +30,7 @@ class IntrospectionTests(TransactionTestCase):
"django_table_names() returned a non-Django table")
def test_django_table_names_retval_type(self):
#15216 - Table name is a list
# Table name is a list #15216
tl = connection.introspection.django_table_names(only_existing=True)
self.assertIs(type(tl), list)
tl = connection.introspection.django_table_names(only_existing=False)

View File

@@ -360,7 +360,7 @@ class MakeMigrationsTests(MigrationTestBase):
self.assertIn('\\u201c\\xd0j\\xe1\\xf1g\\xf3\\u201d', content) # title.default
def test_failing_migration(self):
#21280 - If a migration fails to serialize, it shouldn't generate an empty file.
# If a migration fails to serialize, it shouldn't generate an empty file. #21280
apps.register_model('migrations', UnserializableModel)
with six.assertRaisesRegex(self, ValueError, r'Cannot serialize'):

View File

@@ -166,7 +166,7 @@ class VerboseNameField(models.Model):
field10 = models.FilePathField("verbose field10")
field11 = models.FloatField("verbose field11")
# Don't want to depend on Pillow in this test
#field_image = models.ImageField("verbose field")
# field_image = models.ImageField("verbose field")
field12 = models.IntegerField("verbose field12")
field13 = models.IPAddressField("verbose field13")
field14 = models.GenericIPAddressField("verbose field14", protocol="ipv4")

View File

@@ -955,10 +955,10 @@ class ModelToDictTests(TestCase):
with self.assertNumQueries(0):
d = model_to_dict(art)
#Ensure all many-to-many categories appear in model_to_dict
# Ensure all many-to-many categories appear in model_to_dict
for c in categories:
self.assertIn(c.pk, d['categories'])
#Ensure many-to-many relation appears as a list
# Ensure many-to-many relation appears as a list
self.assertIsInstance(d['categories'], list)

View File

@@ -29,7 +29,7 @@ class Article(models.Model):
class Movie(models.Model):
#5218: Test models with non-default primary keys / AutoFields
# Test models with non-default primary keys / AutoFields #5218
movie_id = models.AutoField(primary_key=True)
name = models.CharField(max_length=60)
@@ -73,7 +73,7 @@ class NonAutoPK(models.Model):
name = models.CharField(max_length=10, primary_key=True)
#18432: Chained foreign keys with to_field produce incorrect query
# Chained foreign keys with to_field produce incorrect query #18432
class Model1(models.Model):
pkey = models.IntegerField(unique=True, db_index=True)

View File

@@ -6,7 +6,7 @@ from django.db import models
from django.utils.encoding import python_2_unicode_compatible
## Basic tests
# Basic tests
@python_2_unicode_compatible
class Author(models.Model):
@@ -88,7 +88,7 @@ class BookReview(models.Model):
notes = models.TextField(null=True, blank=True)
## Models for default manager tests
# Models for default manager tests
class Qualification(models.Model):
name = models.CharField(max_length=10)
@@ -124,7 +124,7 @@ class Department(models.Model):
ordering = ['id']
## GenericRelation/GenericForeignKey tests
# GenericRelation/GenericForeignKey tests
@python_2_unicode_compatible
class TaggedItem(models.Model):
@@ -172,7 +172,7 @@ class Comment(models.Model):
ordering = ['id']
## Models for lookup ordering tests
# Models for lookup ordering tests
class House(models.Model):
name = models.CharField(max_length=50)
@@ -209,7 +209,7 @@ class Person(models.Model):
ordering = ['id']
## Models for nullable FK tests
# Models for nullable FK tests
@python_2_unicode_compatible
class Employee(models.Model):
@@ -224,7 +224,7 @@ class Employee(models.Model):
ordering = ['id']
## Ticket #19607
# Ticket #19607
@python_2_unicode_compatible
class LessonEntry(models.Model):
@@ -244,7 +244,7 @@ class WordEntry(models.Model):
return "%s (%s)" % (self.name, self.id)
## Ticket #21410: Regression when related_name="+"
# Ticket #21410: Regression when related_name="+"
@python_2_unicode_compatible
class Author2(models.Model):

View File

@@ -241,7 +241,7 @@ test_data = [
(data_obj, 81, IntegerData, -123456789),
(data_obj, 82, IntegerData, 0),
(data_obj, 83, IntegerData, None),
#(XX, ImageData
# (XX, ImageData
(data_obj, 90, IPAddressData, "127.0.0.1"),
(data_obj, 91, IPAddressData, None),
(data_obj, 95, GenericIPAddressData, "fe80:1424:2223:6cff:fe8a:2e8a:2151:abcd"),

View File

@@ -94,7 +94,6 @@ class SyndicationFeedTest(FeedTestCase):
'link': 'http://example.com/blog/',
'language': 'en',
'lastBuildDate': last_build_date,
#'atom:link': '',
'ttl': '600',
'copyright': 'Copyright (c) 2007, Sally Smith',
})

View File

@@ -1 +0,0 @@
#from django.conf.urls import patterns, url, include