Fixed #16584 -- Fixed a bunch of typos in code comments. Thanks, Bernhard Essl.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@16598 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
parent
4a993fab18
commit
bce890ace4
|
@ -13,7 +13,7 @@ DEBUG = False
|
||||||
TEMPLATE_DEBUG = False
|
TEMPLATE_DEBUG = False
|
||||||
|
|
||||||
# Whether the framework should propagate raw exceptions rather than catching
|
# Whether the framework should propagate raw exceptions rather than catching
|
||||||
# them. This is useful under some testing siutations and should never be used
|
# them. This is useful under some testing situations and should never be used
|
||||||
# on a live site.
|
# on a live site.
|
||||||
DEBUG_PROPAGATE_EXCEPTIONS = False
|
DEBUG_PROPAGATE_EXCEPTIONS = False
|
||||||
|
|
||||||
|
@ -389,7 +389,7 @@ DECIMAL_SEPARATOR = '.'
|
||||||
# Boolean that sets whether to add thousand separator when formatting numbers
|
# Boolean that sets whether to add thousand separator when formatting numbers
|
||||||
USE_THOUSAND_SEPARATOR = False
|
USE_THOUSAND_SEPARATOR = False
|
||||||
|
|
||||||
# Number of digits that will be together, when spliting them by
|
# Number of digits that will be together, when splitting them by
|
||||||
# THOUSAND_SEPARATOR. 0 means no grouping, 3 means splitting by thousands...
|
# THOUSAND_SEPARATOR. 0 means no grouping, 3 means splitting by thousands...
|
||||||
NUMBER_GROUPING = 0
|
NUMBER_GROUPING = 0
|
||||||
|
|
||||||
|
@ -506,7 +506,7 @@ CSRF_COOKIE_SECURE = False
|
||||||
# MESSAGES #
|
# MESSAGES #
|
||||||
############
|
############
|
||||||
|
|
||||||
# Class to use as messges backend
|
# Class to use as messages backend
|
||||||
MESSAGE_STORAGE = 'django.contrib.messages.storage.fallback.FallbackStorage'
|
MESSAGE_STORAGE = 'django.contrib.messages.storage.fallback.FallbackStorage'
|
||||||
|
|
||||||
# Default values of MESSAGE_LEVEL and MESSAGE_TAGS are defined within
|
# Default values of MESSAGE_LEVEL and MESSAGE_TAGS are defined within
|
||||||
|
|
|
@ -87,7 +87,7 @@ def post_comment(request, next=None, using=None):
|
||||||
# preview templates, so we have to preserve that format.
|
# preview templates, so we have to preserve that format.
|
||||||
"comments/%s_%s_preview.html" % (model._meta.app_label, model._meta.module_name),
|
"comments/%s_%s_preview.html" % (model._meta.app_label, model._meta.module_name),
|
||||||
"comments/%s_preview.html" % model._meta.app_label,
|
"comments/%s_preview.html" % model._meta.app_label,
|
||||||
# Now the usual directory based template heirarchy.
|
# Now the usual directory based template hierarchy.
|
||||||
"comments/%s/%s/preview.html" % (model._meta.app_label, model._meta.module_name),
|
"comments/%s/%s/preview.html" % (model._meta.app_label, model._meta.module_name),
|
||||||
"comments/%s/preview.html" % model._meta.app_label,
|
"comments/%s/preview.html" % model._meta.app_label,
|
||||||
"comments/preview.html",
|
"comments/preview.html",
|
||||||
|
|
|
@ -87,7 +87,7 @@ def approve(request, comment_id, next=None):
|
||||||
)
|
)
|
||||||
|
|
||||||
# The following functions actually perform the various flag/aprove/delete
|
# The following functions actually perform the various flag/aprove/delete
|
||||||
# actions. They've been broken out into seperate functions to that they
|
# actions. They've been broken out into separate functions to that they
|
||||||
# may be called from admin actions.
|
# may be called from admin actions.
|
||||||
|
|
||||||
def perform_flag(request, comment):
|
def perform_flag(request, comment):
|
||||||
|
|
|
@ -152,7 +152,7 @@ class WizardView(TemplateView):
|
||||||
# if not, add the form with a zero based counter as unicode
|
# if not, add the form with a zero based counter as unicode
|
||||||
init_form_list[unicode(i)] = form
|
init_form_list[unicode(i)] = form
|
||||||
|
|
||||||
# walk through the ne created list of forms
|
# walk through the new created list of forms
|
||||||
for form in init_form_list.itervalues():
|
for form in init_form_list.itervalues():
|
||||||
if issubclass(form, formsets.BaseFormSet):
|
if issubclass(form, formsets.BaseFormSet):
|
||||||
# if the element is based on BaseFormSet (FormSet/ModelFormSet)
|
# if the element is based on BaseFormSet (FormSet/ModelFormSet)
|
||||||
|
|
|
@ -536,7 +536,7 @@ class PostGISOperations(DatabaseOperations, BaseSpatialOperations):
|
||||||
op = op(self.geom_func_prefix, value[1])
|
op = op(self.geom_func_prefix, value[1])
|
||||||
elif lookup_type in self.distance_functions and lookup_type != 'dwithin':
|
elif lookup_type in self.distance_functions and lookup_type != 'dwithin':
|
||||||
if not field.geography and field.geodetic(self.connection):
|
if not field.geography and field.geodetic(self.connection):
|
||||||
# Geodetic distances are only availble from Points to
|
# Geodetic distances are only available from Points to
|
||||||
# PointFields on PostGIS 1.4 and below.
|
# PointFields on PostGIS 1.4 and below.
|
||||||
if not self.connection.ops.geography:
|
if not self.connection.ops.geography:
|
||||||
if field.geom_type != 'POINT':
|
if field.geom_type != 'POINT':
|
||||||
|
|
|
@ -90,7 +90,7 @@ class SpatiaLiteOperations(DatabaseOperations, BaseSpatialOperations):
|
||||||
'contains' : SpatiaLiteFunction('Contains'),
|
'contains' : SpatiaLiteFunction('Contains'),
|
||||||
'intersects' : SpatiaLiteFunction('Intersects'),
|
'intersects' : SpatiaLiteFunction('Intersects'),
|
||||||
'relate' : (SpatiaLiteRelate, basestring),
|
'relate' : (SpatiaLiteRelate, basestring),
|
||||||
# Retruns true if B's bounding box completely contains A's bounding box.
|
# Returns true if B's bounding box completely contains A's bounding box.
|
||||||
'contained' : SpatiaLiteFunction('MbrWithin'),
|
'contained' : SpatiaLiteFunction('MbrWithin'),
|
||||||
# Returns true if A's bounding box completely contains B's bounding box.
|
# Returns true if A's bounding box completely contains B's bounding box.
|
||||||
'bbcontains' : SpatiaLiteFunction('MbrContains'),
|
'bbcontains' : SpatiaLiteFunction('MbrContains'),
|
||||||
|
|
|
@ -50,7 +50,7 @@ class Envelope(object):
|
||||||
else:
|
else:
|
||||||
raise TypeError('Incorrect type of argument: %s' % str(type(args[0])))
|
raise TypeError('Incorrect type of argument: %s' % str(type(args[0])))
|
||||||
elif len(args) == 4:
|
elif len(args) == 4:
|
||||||
# Individiual parameters passed in.
|
# Individual parameters passed in.
|
||||||
# Thanks to ww for the help
|
# Thanks to ww for the help
|
||||||
self._from_sequence(map(float, args))
|
self._from_sequence(map(float, args))
|
||||||
else:
|
else:
|
||||||
|
@ -125,7 +125,7 @@ class Envelope(object):
|
||||||
# An x and an y parameter were passed in
|
# An x and an y parameter were passed in
|
||||||
return self.expand_to_include((args[0], args[1], args[0], args[1]))
|
return self.expand_to_include((args[0], args[1], args[0], args[1]))
|
||||||
elif len(args) == 4:
|
elif len(args) == 4:
|
||||||
# Individiual parameters passed in.
|
# Individual parameters passed in.
|
||||||
return self.expand_to_include(args)
|
return self.expand_to_include(args)
|
||||||
else:
|
else:
|
||||||
raise OGRException('Incorrect number (%d) of arguments.' % len(args[0]))
|
raise OGRException('Incorrect number (%d) of arguments.' % len(args[0]))
|
||||||
|
|
|
@ -207,7 +207,7 @@ class ThreadLocalIO(threading.local):
|
||||||
thread_context = ThreadLocalIO()
|
thread_context = ThreadLocalIO()
|
||||||
|
|
||||||
# These module-level routines return the I/O object that is local to the
|
# These module-level routines return the I/O object that is local to the
|
||||||
# the thread. If the I/O object does not exist yet it will be initialized.
|
# thread. If the I/O object does not exist yet it will be initialized.
|
||||||
def wkt_r():
|
def wkt_r():
|
||||||
if not thread_context.wkt_r:
|
if not thread_context.wkt_r:
|
||||||
thread_context.wkt_r = _WKTReader()
|
thread_context.wkt_r = _WKTReader()
|
||||||
|
|
|
@ -41,7 +41,7 @@ class GoogleZoom(object):
|
||||||
# Getting the degrees and radians per pixel, and the 1/2 the number of
|
# Getting the degrees and radians per pixel, and the 1/2 the number of
|
||||||
# for every zoom level.
|
# for every zoom level.
|
||||||
self._degpp.append(z / 360.) # degrees per pixel
|
self._degpp.append(z / 360.) # degrees per pixel
|
||||||
self._radpp.append(z / (2 * pi)) # radians per pixl
|
self._radpp.append(z / (2 * pi)) # radians per pixel
|
||||||
self._npix.append(z / 2) # number of pixels to center of tile
|
self._npix.append(z / 2) # number of pixels to center of tile
|
||||||
|
|
||||||
# Multiplying `z` by 2 for the next iteration.
|
# Multiplying `z` by 2 for the next iteration.
|
||||||
|
|
|
@ -671,7 +671,7 @@ class GeoModelTest(TestCase):
|
||||||
'12.40500 43.94833,12.40889 43.95499,12.41580 43.95795)))')
|
'12.40500 43.94833,12.40889 43.95499,12.41580 43.95795)))')
|
||||||
sm = Country.objects.create(name='San Marino', mpoly=fromstr(wkt))
|
sm = Country.objects.create(name='San Marino', mpoly=fromstr(wkt))
|
||||||
|
|
||||||
# Because floating-point arithmitic isn't exact, we set a tolerance
|
# Because floating-point arithmetic isn't exact, we set a tolerance
|
||||||
# to pass into GEOS `equals_exact`.
|
# to pass into GEOS `equals_exact`.
|
||||||
tol = 0.000000001
|
tol = 0.000000001
|
||||||
|
|
||||||
|
|
|
@ -130,7 +130,7 @@ class RelatedGeoModelTest(TestCase):
|
||||||
|
|
||||||
# Now creating a second Parcel where the borders are the same, just
|
# Now creating a second Parcel where the borders are the same, just
|
||||||
# in different coordinate systems. The center points are also the
|
# in different coordinate systems. The center points are also the
|
||||||
# the same (but in different coordinate systems), and this time they
|
# same (but in different coordinate systems), and this time they
|
||||||
# actually correspond to the centroid of the border.
|
# actually correspond to the centroid of the border.
|
||||||
c1 = b1.centroid
|
c1 = b1.centroid
|
||||||
c2 = c1.transform(2276, clone=True)
|
c2 = c1.transform(2276, clone=True)
|
||||||
|
|
|
@ -134,7 +134,7 @@ class CZICNumberField(Field):
|
||||||
# remainder is equal:
|
# remainder is equal:
|
||||||
# 0 or 10: last digit is 1
|
# 0 or 10: last digit is 1
|
||||||
# 1: last digit is 0
|
# 1: last digit is 0
|
||||||
# in other case, last digin is 11 - remainder
|
# in other case, last digit is 11 - remainder
|
||||||
|
|
||||||
if (not remainder % 10 and check == 1) or \
|
if (not remainder % 10 and check == 1) or \
|
||||||
(remainder == 1 and check == 0) or \
|
(remainder == 1 and check == 0) or \
|
||||||
|
|
|
@ -140,7 +140,7 @@ class Command(NoArgsCommand):
|
||||||
|
|
||||||
if verbosity >= 1:
|
if verbosity >= 1:
|
||||||
print "Installing indexes ..."
|
print "Installing indexes ..."
|
||||||
# Install SQL indicies for all newly created models
|
# Install SQL indices for all newly created models
|
||||||
for app_name, model_list in manifest.items():
|
for app_name, model_list in manifest.items():
|
||||||
for model in model_list:
|
for model in model_list:
|
||||||
if model in created_models:
|
if model in created_models:
|
||||||
|
|
|
@ -11,7 +11,7 @@ def sql_create(app, style, connection):
|
||||||
|
|
||||||
if connection.settings_dict['ENGINE'] == 'django.db.backends.dummy':
|
if connection.settings_dict['ENGINE'] == 'django.db.backends.dummy':
|
||||||
# This must be the "dummy" database backend, which means the user
|
# This must be the "dummy" database backend, which means the user
|
||||||
# hasn't set ENGINE for the databse.
|
# hasn't set ENGINE for the database.
|
||||||
raise CommandError("Django doesn't know which syntax to use for your SQL statements,\n" +
|
raise CommandError("Django doesn't know which syntax to use for your SQL statements,\n" +
|
||||||
"because you haven't specified the ENGINE setting for the database.\n" +
|
"because you haven't specified the ENGINE setting for the database.\n" +
|
||||||
"Edit your settings file and change DATBASES['default']['ENGINE'] to something like\n" +
|
"Edit your settings file and change DATBASES['default']['ENGINE'] to something like\n" +
|
||||||
|
|
|
@ -217,7 +217,7 @@ class Collector(object):
|
||||||
self.data[model] = sorted(instances, key=attrgetter("pk"))
|
self.data[model] = sorted(instances, key=attrgetter("pk"))
|
||||||
|
|
||||||
# if possible, bring the models in an order suitable for databases that
|
# if possible, bring the models in an order suitable for databases that
|
||||||
# don't support transactions or cannot defer contraint checks until the
|
# don't support transactions or cannot defer constraint checks until the
|
||||||
# end of a transaction.
|
# end of a transaction.
|
||||||
self.sort()
|
self.sort()
|
||||||
|
|
||||||
|
|
|
@ -213,7 +213,7 @@ class BaseFormSet(StrAndUnicode):
|
||||||
return (1, 0) # +infinity, larger than any number
|
return (1, 0) # +infinity, larger than any number
|
||||||
return (0, k[1])
|
return (0, k[1])
|
||||||
self._ordering.sort(key=compare_ordering_key)
|
self._ordering.sort(key=compare_ordering_key)
|
||||||
# Return a list of form.cleaned_data dicts in the order spcified by
|
# Return a list of form.cleaned_data dicts in the order specified by
|
||||||
# the form data.
|
# the form data.
|
||||||
return [self.forms[i[0]] for i in self._ordering]
|
return [self.forms[i[0]] for i in self._ordering]
|
||||||
ordered_forms = property(_get_ordered_forms)
|
ordered_forms = property(_get_ordered_forms)
|
||||||
|
|
|
@ -117,7 +117,7 @@ def model_to_dict(instance, fields=None, exclude=None):
|
||||||
if exclude and f.name in exclude:
|
if exclude and f.name in exclude:
|
||||||
continue
|
continue
|
||||||
if isinstance(f, ManyToManyField):
|
if isinstance(f, ManyToManyField):
|
||||||
# If the object doesn't have a primry key yet, just use an empty
|
# If the object doesn't have a primary key yet, just use an empty
|
||||||
# list for its m2m fields. Calling f.value_from_object will raise
|
# list for its m2m fields. Calling f.value_from_object will raise
|
||||||
# an exception.
|
# an exception.
|
||||||
if instance.pk is None:
|
if instance.pk is None:
|
||||||
|
@ -288,7 +288,7 @@ class BaseModelForm(BaseForm):
|
||||||
# Exclude empty fields that are not required by the form, if the
|
# Exclude empty fields that are not required by the form, if the
|
||||||
# underlying model field is required. This keeps the model field
|
# underlying model field is required. This keeps the model field
|
||||||
# from raising a required error. Note: don't exclude the field from
|
# from raising a required error. Note: don't exclude the field from
|
||||||
# validaton if the model field allows blanks. If it does, the blank
|
# validation if the model field allows blanks. If it does, the blank
|
||||||
# value may be included in a unique check, so cannot be excluded
|
# value may be included in a unique check, so cannot be excluded
|
||||||
# from validation.
|
# from validation.
|
||||||
else:
|
else:
|
||||||
|
|
|
@ -282,7 +282,7 @@ class HttpRequest(object):
|
||||||
|
|
||||||
def _get_upload_handlers(self):
|
def _get_upload_handlers(self):
|
||||||
if not self._upload_handlers:
|
if not self._upload_handlers:
|
||||||
# If thre are no upload handlers defined, initialize them from settings.
|
# If there are no upload handlers defined, initialize them from settings.
|
||||||
self._initialize_handlers()
|
self._initialize_handlers()
|
||||||
return self._upload_handlers
|
return self._upload_handlers
|
||||||
|
|
||||||
|
|
|
@ -22,7 +22,7 @@ class GZipMiddleware(object):
|
||||||
if response.has_header('Content-Encoding'):
|
if response.has_header('Content-Encoding'):
|
||||||
return response
|
return response
|
||||||
|
|
||||||
# MSIE have issues with gzipped respones of various content types.
|
# MSIE have issues with gzipped response of various content types.
|
||||||
if "msie" in request.META.get('HTTP_USER_AGENT', '').lower():
|
if "msie" in request.META.get('HTTP_USER_AGENT', '').lower():
|
||||||
ctype = response.get('Content-Type', '').lower()
|
ctype = response.get('Content-Type', '').lower()
|
||||||
if not ctype.startswith("text/") or "javascript" in ctype:
|
if not ctype.startswith("text/") or "javascript" in ctype:
|
||||||
|
|
|
@ -552,7 +552,7 @@ class DocTestParser:
|
||||||
^ (?P<msg> \w+ .*) # a line *starts* with alphanum.
|
^ (?P<msg> \w+ .*) # a line *starts* with alphanum.
|
||||||
""", re.VERBOSE | re.MULTILINE | re.DOTALL)
|
""", re.VERBOSE | re.MULTILINE | re.DOTALL)
|
||||||
|
|
||||||
# A callable returning a true value iff its argument is a blank line
|
# A callable returning a true value if its argument is a blank line
|
||||||
# or contains a single comment.
|
# or contains a single comment.
|
||||||
_IS_BLANK_OR_COMMENT = re.compile(r'^[ ]*(#.*)?$').match
|
_IS_BLANK_OR_COMMENT = re.compile(r'^[ ]*(#.*)?$').match
|
||||||
|
|
||||||
|
|
|
@ -43,7 +43,7 @@
|
||||||
#
|
#
|
||||||
# - It's impossible to programmatically determine which forms should and should
|
# - It's impossible to programmatically determine which forms should and should
|
||||||
# not have the token added. The developer must decide when to do this,
|
# not have the token added. The developer must decide when to do this,
|
||||||
# ensuring that the token is only added to internally targetted forms.
|
# ensuring that the token is only added to internally targeted forms.
|
||||||
#
|
#
|
||||||
# - It's impossible to programmatically work out when a template is used. The
|
# - It's impossible to programmatically work out when a template is used. The
|
||||||
# attempts to trace back to view functions are guesses, and could easily fail
|
# attempts to trace back to view functions are guesses, and could easily fail
|
||||||
|
|
|
@ -251,7 +251,7 @@ class LookupTests(TestCase):
|
||||||
def test_values_list(self):
|
def test_values_list(self):
|
||||||
# values_list() is similar to values(), except that the results are
|
# values_list() is similar to values(), except that the results are
|
||||||
# returned as a list of tuples, rather than a list of dictionaries.
|
# returned as a list of tuples, rather than a list of dictionaries.
|
||||||
# Within each tuple, the order of the elemnts is the same as the order
|
# Within each tuple, the order of the elements is the same as the order
|
||||||
# of fields in the values_list() call.
|
# of fields in the values_list() call.
|
||||||
identity = lambda x:x
|
identity = lambda x:x
|
||||||
self.assertQuerysetEqual(Article.objects.values_list('headline'),
|
self.assertQuerysetEqual(Article.objects.values_list('headline'),
|
||||||
|
|
|
@ -5,7 +5,7 @@ is generated for the table on various manage.py operations.
|
||||||
|
|
||||||
from django.db import models
|
from django.db import models
|
||||||
|
|
||||||
# All of these models are creatd in the database by Django.
|
# All of these models are created in the database by Django.
|
||||||
|
|
||||||
class A01(models.Model):
|
class A01(models.Model):
|
||||||
f_a = models.CharField(max_length=10, db_index=True)
|
f_a = models.CharField(max_length=10, db_index=True)
|
||||||
|
|
|
@ -274,7 +274,7 @@ class ForeignKeyRawIdWidgetTest(DjangoTestCase):
|
||||||
)
|
)
|
||||||
|
|
||||||
def test_fk_related_model_not_in_admin(self):
|
def test_fk_related_model_not_in_admin(self):
|
||||||
# FK to a model not registered with admin site. Raw ID widget shoud
|
# FK to a model not registered with admin site. Raw ID widget should
|
||||||
# have no magnifying glass link. See #16542
|
# have no magnifying glass link. See #16542
|
||||||
big_honeycomb = models.Honeycomb.objects.create(location='Old tree')
|
big_honeycomb = models.Honeycomb.objects.create(location='Old tree')
|
||||||
big_honeycomb.bee_set.create()
|
big_honeycomb.bee_set.create()
|
||||||
|
@ -287,7 +287,7 @@ class ForeignKeyRawIdWidgetTest(DjangoTestCase):
|
||||||
)
|
)
|
||||||
|
|
||||||
def test_fk_to_self_model_not_in_admin(self):
|
def test_fk_to_self_model_not_in_admin(self):
|
||||||
# FK to self, not registered with admin site. Raw ID widget shoud have
|
# FK to self, not registered with admin site. Raw ID widget should have
|
||||||
# no magnifying glass link. See #16542
|
# no magnifying glass link. See #16542
|
||||||
subject1 = models.Individual.objects.create(name='Subject #1')
|
subject1 = models.Individual.objects.create(name='Subject #1')
|
||||||
models.Individual.objects.create(name='Child', parent=subject1)
|
models.Individual.objects.create(name='Child', parent=subject1)
|
||||||
|
@ -345,7 +345,7 @@ class ManyToManyRawIdWidgetTest(DjangoTestCase):
|
||||||
|
|
||||||
def test_m2m_related_model_not_in_admin(self):
|
def test_m2m_related_model_not_in_admin(self):
|
||||||
# M2M relationship with model not registered with admin site. Raw ID
|
# M2M relationship with model not registered with admin site. Raw ID
|
||||||
# widget shoud have no magnifying glass link. See #16542
|
# widget should have no magnifying glass link. See #16542
|
||||||
consultor1 = models.Advisor.objects.create(name='Rockstar Techie')
|
consultor1 = models.Advisor.objects.create(name='Rockstar Techie')
|
||||||
|
|
||||||
c1 = models.Company.objects.create(name='Doodle')
|
c1 = models.Company.objects.create(name='Doodle')
|
||||||
|
|
|
@ -644,7 +644,7 @@ class AggregationTests(TestCase):
|
||||||
)
|
)
|
||||||
|
|
||||||
# Regression for #10766 - Shouldn't be able to reference an aggregate
|
# Regression for #10766 - Shouldn't be able to reference an aggregate
|
||||||
# fields in an an aggregate() call.
|
# fields in an aggregate() call.
|
||||||
self.assertRaises(
|
self.assertRaises(
|
||||||
FieldError,
|
FieldError,
|
||||||
lambda: Book.objects.annotate(mean_age=Avg('authors__age')).annotate(Avg('mean_age'))
|
lambda: Book.objects.annotate(mean_age=Avg('authors__age')).annotate(Avg('mean_age'))
|
||||||
|
|
|
@ -220,7 +220,7 @@ class BaseCacheTests(object):
|
||||||
self.assertEqual(self.cache.has_key("goodbye1"), False)
|
self.assertEqual(self.cache.has_key("goodbye1"), False)
|
||||||
|
|
||||||
def test_in(self):
|
def test_in(self):
|
||||||
# The in operator can be used to inspet cache contents
|
# The in operator can be used to inspect cache contents
|
||||||
self.cache.set("hello2", "goodbye2")
|
self.cache.set("hello2", "goodbye2")
|
||||||
self.assertEqual("hello2" in self.cache, True)
|
self.assertEqual("hello2" in self.cache, True)
|
||||||
self.assertEqual("goodbye2" in self.cache, False)
|
self.assertEqual("goodbye2" in self.cache, False)
|
||||||
|
@ -338,7 +338,7 @@ class BaseCacheTests(object):
|
||||||
self.assertEqual(self.cache.get(key), value)
|
self.assertEqual(self.cache.get(key), value)
|
||||||
|
|
||||||
def test_binary_string(self):
|
def test_binary_string(self):
|
||||||
# Binary strings should be cachable
|
# Binary strings should be cacheable
|
||||||
from zlib import compress, decompress
|
from zlib import compress, decompress
|
||||||
value = 'value_to_be_compressed'
|
value = 'value_to_be_compressed'
|
||||||
compressed_value = compress(value)
|
compressed_value = compress(value)
|
||||||
|
|
|
@ -339,7 +339,7 @@ class DayArchiveViewTests(TestCase):
|
||||||
self.assertEqual(list(res.context['book_list']), [b])
|
self.assertEqual(list(res.context['book_list']), [b])
|
||||||
self.assertEqual(res.context['day'], future)
|
self.assertEqual(res.context['day'], future)
|
||||||
|
|
||||||
# allow_future but not allow_empty, next/prev amust be valid
|
# allow_future but not allow_empty, next/prev must be valid
|
||||||
self.assertEqual(res.context['next_day'], None)
|
self.assertEqual(res.context['next_day'], None)
|
||||||
self.assertEqual(res.context['previous_day'], datetime.date(2008, 10, 1))
|
self.assertEqual(res.context['previous_day'], datetime.date(2008, 10, 1))
|
||||||
|
|
||||||
|
|
|
@ -1085,7 +1085,7 @@ class RouterTestCase(TestCase):
|
||||||
self.assertEqual(list(pro.authors.values_list('name', flat=True)), [u'Marty Alchin'])
|
self.assertEqual(list(pro.authors.values_list('name', flat=True)), [u'Marty Alchin'])
|
||||||
self.assertEqual(pro.editor.name, u'Marty Alchin')
|
self.assertEqual(pro.editor.name, u'Marty Alchin')
|
||||||
|
|
||||||
# get_or_create is a special case. The get needs to be targetted at
|
# get_or_create is a special case. The get needs to be targeted at
|
||||||
# the write database in order to avoid potential transaction
|
# the write database in order to avoid potential transaction
|
||||||
# consistency problems
|
# consistency problems
|
||||||
book, created = Book.objects.get_or_create(title="Pro Django")
|
book, created = Book.objects.get_or_create(title="Pro Django")
|
||||||
|
|
Loading…
Reference in New Issue