Fixed several typos in Django
This commit is contained in:
parent
e79725cdf9
commit
1dcc603eff
|
@ -259,7 +259,7 @@ ABSOLUTE_URL_OVERRIDES = {}
|
||||||
# Example: ('/home/html', '/var/www')
|
# Example: ('/home/html', '/var/www')
|
||||||
ALLOWED_INCLUDE_ROOTS = ()
|
ALLOWED_INCLUDE_ROOTS = ()
|
||||||
|
|
||||||
# If this is a admin settings module, this should be a list of
|
# If this is an admin settings module, this should be a list of
|
||||||
# settings modules (in the format 'foo.bar.baz') for which this admin
|
# settings modules (in the format 'foo.bar.baz') for which this admin
|
||||||
# is an admin.
|
# is an admin.
|
||||||
ADMIN_FOR = ()
|
ADMIN_FOR = ()
|
||||||
|
|
|
@ -373,7 +373,7 @@ class NoBackendsTest(TestCase):
|
||||||
@skipIfCustomUser
|
@skipIfCustomUser
|
||||||
class InActiveUserBackendTest(TestCase):
|
class InActiveUserBackendTest(TestCase):
|
||||||
"""
|
"""
|
||||||
Tests for a inactive user
|
Tests for an inactive user
|
||||||
"""
|
"""
|
||||||
backend = 'django.contrib.auth.tests.test_auth_backends.SimpleRowlevelBackend'
|
backend = 'django.contrib.auth.tests.test_auth_backends.SimpleRowlevelBackend'
|
||||||
|
|
||||||
|
|
|
@ -229,7 +229,7 @@ class CreatesuperuserManagementCommandTestCase(TestCase):
|
||||||
self.assertEqual(command_output, 'Superuser created successfully.')
|
self.assertEqual(command_output, 'Superuser created successfully.')
|
||||||
|
|
||||||
def test_verbosity_zero(self):
|
def test_verbosity_zero(self):
|
||||||
# We can supress output on the management command
|
# We can suppress output on the management command
|
||||||
new_io = six.StringIO()
|
new_io = six.StringIO()
|
||||||
call_command(
|
call_command(
|
||||||
"createsuperuser",
|
"createsuperuser",
|
||||||
|
|
|
@ -369,13 +369,13 @@ class WizardView(TemplateView):
|
||||||
"""
|
"""
|
||||||
Returns a dictionary which will be passed to the form for `step`
|
Returns a dictionary which will be passed to the form for `step`
|
||||||
as `initial`. If no initial data was provided while initializing the
|
as `initial`. If no initial data was provided while initializing the
|
||||||
form wizard, a empty dictionary will be returned.
|
form wizard, an empty dictionary will be returned.
|
||||||
"""
|
"""
|
||||||
return self.initial_dict.get(step, {})
|
return self.initial_dict.get(step, {})
|
||||||
|
|
||||||
def get_form_instance(self, step):
|
def get_form_instance(self, step):
|
||||||
"""
|
"""
|
||||||
Returns a object which will be passed to the form for `step`
|
Returns an object which will be passed to the form for `step`
|
||||||
as `instance`. If no instance object was provided while initializing
|
as `instance`. If no instance object was provided while initializing
|
||||||
the form wizard, None will be returned.
|
the form wizard, None will be returned.
|
||||||
"""
|
"""
|
||||||
|
|
|
@ -233,7 +233,7 @@ class OracleOperations(DatabaseOperations, BaseSpatialOperations):
|
||||||
"Returns the SQL WHERE clause for use in Oracle spatial SQL construction."
|
"Returns the SQL WHERE clause for use in Oracle spatial SQL construction."
|
||||||
geo_col, db_type = lvalue
|
geo_col, db_type = lvalue
|
||||||
|
|
||||||
# See if a Oracle Geometry function matches the lookup type next
|
# See if an Oracle Geometry function matches the lookup type next
|
||||||
lookup_info = self.geometry_functions.get(lookup_type, False)
|
lookup_info = self.geometry_functions.get(lookup_type, False)
|
||||||
if lookup_info:
|
if lookup_info:
|
||||||
# Lookup types that are tuples take tuple arguments, e.g., 'relate' and
|
# Lookup types that are tuples take tuple arguments, e.g., 'relate' and
|
||||||
|
|
|
@ -142,7 +142,7 @@ class CookieStorage(BaseStorage):
|
||||||
|
|
||||||
def _decode(self, data):
|
def _decode(self, data):
|
||||||
"""
|
"""
|
||||||
Safely decodes a encoded text stream back into a list of messages.
|
Safely decodes an encoded text stream back into a list of messages.
|
||||||
|
|
||||||
If the encoded text stream contained an invalid hash or was in an
|
If the encoded text stream contained an invalid hash or was in an
|
||||||
invalid format, ``None`` is returned.
|
invalid format, ``None`` is returned.
|
||||||
|
|
|
@ -101,7 +101,7 @@ class Storage(object):
|
||||||
Returns True if a file referenced by the given name already exists in the
|
Returns True if a file referenced by the given name already exists in the
|
||||||
storage system, or False if the name is available for a new file.
|
storage system, or False if the name is available for a new file.
|
||||||
"""
|
"""
|
||||||
raise NotImplementedError('subclasses of Storage must provide a exists() method')
|
raise NotImplementedError('subclasses of Storage must provide an exists() method')
|
||||||
|
|
||||||
def listdir(self, path):
|
def listdir(self, path):
|
||||||
"""
|
"""
|
||||||
|
|
|
@ -341,7 +341,7 @@ class EmailMessage(object):
|
||||||
content = content.message()
|
content = content.message()
|
||||||
elif not isinstance(content, Message):
|
elif not isinstance(content, Message):
|
||||||
# For compatibility with existing code, parse the message
|
# For compatibility with existing code, parse the message
|
||||||
# into a email.Message object if it is not one already.
|
# into an email.Message object if it is not one already.
|
||||||
content = message_from_string(content)
|
content = message_from_string(content)
|
||||||
|
|
||||||
attachment = SafeMIMEMessage(content, subtype)
|
attachment = SafeMIMEMessage(content, subtype)
|
||||||
|
|
|
@ -252,7 +252,7 @@ class ManagementUtility(object):
|
||||||
Subcommand options are saved as pairs. A pair consists of
|
Subcommand options are saved as pairs. A pair consists of
|
||||||
the long option string (e.g. '--exclude') and a boolean
|
the long option string (e.g. '--exclude') and a boolean
|
||||||
value indicating if the option requires arguments. When printing to
|
value indicating if the option requires arguments. When printing to
|
||||||
stdout, a equal sign is appended to options which require arguments.
|
stdout, an equal sign is appended to options which require arguments.
|
||||||
|
|
||||||
Note: If debugging this function, it is recommended to write the debug
|
Note: If debugging this function, it is recommended to write the debug
|
||||||
output in a separate file. Otherwise the debug output will be treated
|
output in a separate file. Otherwise the debug output will be treated
|
||||||
|
|
|
@ -331,7 +331,7 @@ class BaseCommand(object):
|
||||||
|
|
||||||
try:
|
try:
|
||||||
if (self.requires_system_checks and
|
if (self.requires_system_checks and
|
||||||
not options.get('skip_validation') and # This will be removed at the end of deprecation proccess for `skip_validation`.
|
not options.get('skip_validation') and # This will be removed at the end of deprecation process for `skip_validation`.
|
||||||
not options.get('skip_checks')):
|
not options.get('skip_checks')):
|
||||||
self.check()
|
self.check()
|
||||||
output = self.handle(*args, **options)
|
output = self.handle(*args, **options)
|
||||||
|
|
|
@ -28,7 +28,7 @@ DEFAULT_PORT = "8000"
|
||||||
class Command(BaseCommand):
|
class Command(BaseCommand):
|
||||||
option_list = BaseCommand.option_list + (
|
option_list = BaseCommand.option_list + (
|
||||||
make_option('--ipv6', '-6', action='store_true', dest='use_ipv6', default=False,
|
make_option('--ipv6', '-6', action='store_true', dest='use_ipv6', default=False,
|
||||||
help='Tells Django to use a IPv6 address.'),
|
help='Tells Django to use an IPv6 address.'),
|
||||||
make_option('--nothreading', action='store_false', dest='use_threading', default=True,
|
make_option('--nothreading', action='store_false', dest='use_threading', default=True,
|
||||||
help='Tells Django to NOT use threading.'),
|
help='Tells Django to NOT use threading.'),
|
||||||
make_option('--noreload', action='store_false', dest='use_reloader', default=True,
|
make_option('--noreload', action='store_false', dest='use_reloader', default=True,
|
||||||
|
|
|
@ -11,7 +11,7 @@ class Command(BaseCommand):
|
||||||
type='string', default='',
|
type='string', default='',
|
||||||
help='port number or ipaddr:port to run the server on'),
|
help='port number or ipaddr:port to run the server on'),
|
||||||
make_option('--ipv6', '-6', action='store_true', dest='use_ipv6', default=False,
|
make_option('--ipv6', '-6', action='store_true', dest='use_ipv6', default=False,
|
||||||
help='Tells Django to use a IPv6 address.'),
|
help='Tells Django to use an IPv6 address.'),
|
||||||
)
|
)
|
||||||
help = 'Runs a development server with data from the given fixture(s).'
|
help = 'Runs a development server with data from the given fixture(s).'
|
||||||
args = '[fixture ...]'
|
args = '[fixture ...]'
|
||||||
|
|
|
@ -132,7 +132,7 @@ def serialize(format, queryset, **options):
|
||||||
def deserialize(format, stream_or_string, **options):
|
def deserialize(format, stream_or_string, **options):
|
||||||
"""
|
"""
|
||||||
Deserialize a stream or a string. Returns an iterator that yields ``(obj,
|
Deserialize a stream or a string. Returns an iterator that yields ``(obj,
|
||||||
m2m_relation_dict)``, where ``obj`` is a instantiated -- but *unsaved* --
|
m2m_relation_dict)``, where ``obj`` is an instantiated -- but *unsaved* --
|
||||||
object, and ``m2m_relation_dict`` is a dictionary of ``{m2m_field_name :
|
object, and ``m2m_relation_dict`` is a dictionary of ``{m2m_field_name :
|
||||||
list_of_related_objects}``.
|
list_of_related_objects}``.
|
||||||
"""
|
"""
|
||||||
|
|
|
@ -3,7 +3,7 @@ FastCGI (or SCGI, or AJP1.3 ...) server that implements the WSGI protocol.
|
||||||
|
|
||||||
Uses the flup python package: http://www.saddi.com/software/flup/
|
Uses the flup python package: http://www.saddi.com/software/flup/
|
||||||
|
|
||||||
This is a adaptation of the flup package to add FastCGI server support
|
This is an adaptation of the flup package to add FastCGI server support
|
||||||
to run Django apps from Web servers that support the FastCGI protocol.
|
to run Django apps from Web servers that support the FastCGI protocol.
|
||||||
This module can be run standalone or from the django-admin / manage.py
|
This module can be run standalone or from the django-admin / manage.py
|
||||||
scripts using the "runfcgi" directive.
|
scripts using the "runfcgi" directive.
|
||||||
|
|
|
@ -542,7 +542,7 @@ class Options(object):
|
||||||
"""
|
"""
|
||||||
Returns a list of parent classes leading to 'model' (order from closet
|
Returns a list of parent classes leading to 'model' (order from closet
|
||||||
to most distant ancestor). This has to handle the case were 'model' is
|
to most distant ancestor). This has to handle the case were 'model' is
|
||||||
a granparent or even more distant relation.
|
a grandparent or even more distant relation.
|
||||||
"""
|
"""
|
||||||
if not self.parents:
|
if not self.parents:
|
||||||
return None
|
return None
|
||||||
|
|
|
@ -1780,7 +1780,7 @@ def prefetch_related_objects(result_cache, related_lookups):
|
||||||
# Last one, this *must* resolve to something that supports
|
# Last one, this *must* resolve to something that supports
|
||||||
# prefetching, otherwise there is no point adding it and the
|
# prefetching, otherwise there is no point adding it and the
|
||||||
# developer asking for it has made a mistake.
|
# developer asking for it has made a mistake.
|
||||||
raise ValueError("'%s' does not resolve to a item that supports "
|
raise ValueError("'%s' does not resolve to an item that supports "
|
||||||
"prefetching - this is an invalid parameter to "
|
"prefetching - this is an invalid parameter to "
|
||||||
"prefetch_related()." % lookup.prefetch_through)
|
"prefetch_related()." % lookup.prefetch_through)
|
||||||
|
|
||||||
|
|
|
@ -1491,7 +1491,7 @@ class Query(object):
|
||||||
query.remove_inherited_models()
|
query.remove_inherited_models()
|
||||||
|
|
||||||
# Add extra check to make sure the selected field will not be null
|
# Add extra check to make sure the selected field will not be null
|
||||||
# since we are adding a IN <subquery> clause. This prevents the
|
# since we are adding an IN <subquery> clause. This prevents the
|
||||||
# database from tripping over IN (...,NULL,...) selects and returning
|
# database from tripping over IN (...,NULL,...) selects and returning
|
||||||
# nothing
|
# nothing
|
||||||
alias, col = query.select[0].col
|
alias, col = query.select[0].col
|
||||||
|
@ -2091,7 +2091,7 @@ class JoinPromoter(object):
|
||||||
# join.
|
# join.
|
||||||
# Note that in this example we could just as well have the __gte
|
# Note that in this example we could just as well have the __gte
|
||||||
# clause and the OR clause swapped. Or we could replace the __gte
|
# clause and the OR clause swapped. Or we could replace the __gte
|
||||||
# clause with a OR clause containing rel_a__col=1|rel_a__col=2,
|
# clause with an OR clause containing rel_a__col=1|rel_a__col=2,
|
||||||
# and again we could safely demote to INNER.
|
# and again we could safely demote to INNER.
|
||||||
query.promote_joins(to_promote)
|
query.promote_joins(to_promote)
|
||||||
query.demote_joins(to_demote)
|
query.demote_joins(to_demote)
|
||||||
|
|
|
@ -79,7 +79,7 @@ class Field(object):
|
||||||
# messages that the field will raise.
|
# messages that the field will raise.
|
||||||
# show_hidden_initial -- Boolean that specifies if it is needed to render a
|
# show_hidden_initial -- Boolean that specifies if it is needed to render a
|
||||||
# hidden widget with initial value after widget.
|
# hidden widget with initial value after widget.
|
||||||
# validators -- List of addtional validators to use
|
# validators -- List of additional validators to use
|
||||||
# localize -- Boolean that specifies if the field should be localized.
|
# localize -- Boolean that specifies if the field should be localized.
|
||||||
# label_suffix -- Suffix to be added to the label. Overrides
|
# label_suffix -- Suffix to be added to the label. Overrides
|
||||||
# form's label_suffix.
|
# form's label_suffix.
|
||||||
|
|
|
@ -3,7 +3,7 @@ from django.utils.http import http_date, parse_http_date_safe
|
||||||
|
|
||||||
class ConditionalGetMiddleware(object):
|
class ConditionalGetMiddleware(object):
|
||||||
"""
|
"""
|
||||||
Handles conditional GET operations. If the response has a ETag or
|
Handles conditional GET operations. If the response has an ETag or
|
||||||
Last-Modified header, and the request has If-None-Match or
|
Last-Modified header, and the request has If-None-Match or
|
||||||
If-Modified-Since, the response is replaced by an HttpNotModified.
|
If-Modified-Since, the response is replaced by an HttpNotModified.
|
||||||
|
|
||||||
|
|
|
@ -9,7 +9,7 @@ from django.utils.six.moves import xrange
|
||||||
def clean_ipv6_address(ip_str, unpack_ipv4=False,
|
def clean_ipv6_address(ip_str, unpack_ipv4=False,
|
||||||
error_message=_("This is not a valid IPv6 address.")):
|
error_message=_("This is not a valid IPv6 address.")):
|
||||||
"""
|
"""
|
||||||
Cleans a IPv6 address string.
|
Cleans an IPv6 address string.
|
||||||
|
|
||||||
Validity is checked by calling is_valid_ipv6_address() - if an
|
Validity is checked by calling is_valid_ipv6_address() - if an
|
||||||
invalid address is passed, ValidationError is raised.
|
invalid address is passed, ValidationError is raised.
|
||||||
|
@ -90,7 +90,7 @@ def clean_ipv6_address(ip_str, unpack_ipv4=False,
|
||||||
|
|
||||||
def _sanitize_ipv4_mapping(ip_str):
|
def _sanitize_ipv4_mapping(ip_str):
|
||||||
"""
|
"""
|
||||||
Sanitize IPv4 mapping in a expanded IPv6 address.
|
Sanitize IPv4 mapping in an expanded IPv6 address.
|
||||||
|
|
||||||
This converts ::ffff:0a0a:0a0a to ::ffff:10.10.10.10.
|
This converts ::ffff:0a0a:0a0a to ::ffff:10.10.10.10.
|
||||||
If there is nothing to sanitize, returns an unchanged
|
If there is nothing to sanitize, returns an unchanged
|
||||||
|
|
|
@ -305,7 +305,7 @@ epub_theme = 'djangodocs-epub'
|
||||||
# The scheme of the identifier. Typical schemes are ISBN or URL.
|
# The scheme of the identifier. Typical schemes are ISBN or URL.
|
||||||
#epub_scheme = ''
|
#epub_scheme = ''
|
||||||
|
|
||||||
# The unique identifier of the text. This can be a ISBN number
|
# The unique identifier of the text. This can be an ISBN number
|
||||||
# or the project homepage.
|
# or the project homepage.
|
||||||
#epub_identifier = ''
|
#epub_identifier = ''
|
||||||
|
|
||||||
|
|
|
@ -216,7 +216,7 @@ class SubscriberAdmin(admin.ModelAdmin):
|
||||||
def mail_admin(self, request, selected):
|
def mail_admin(self, request, selected):
|
||||||
EmailMessage(
|
EmailMessage(
|
||||||
'Greetings from a ModelAdmin action',
|
'Greetings from a ModelAdmin action',
|
||||||
'This is the test email from a admin action',
|
'This is the test email from an admin action',
|
||||||
'from@example.com',
|
'from@example.com',
|
||||||
['to@example.com']
|
['to@example.com']
|
||||||
).send()
|
).send()
|
||||||
|
|
|
@ -461,7 +461,7 @@ class FormsFormsetTestCase(TestCase):
|
||||||
def test_formsets_with_ordering(self):
|
def test_formsets_with_ordering(self):
|
||||||
# FormSets with ordering ######################################################
|
# FormSets with ordering ######################################################
|
||||||
# We can also add ordering ability to a FormSet with an argument to
|
# We can also add ordering ability to a FormSet with an argument to
|
||||||
# formset_factory. This will add a integer field to each form instance. When
|
# formset_factory. This will add an integer field to each form instance. When
|
||||||
# form validation succeeds, [form.cleaned_data for form in formset.forms] will have the data in the correct
|
# form validation succeeds, [form.cleaned_data for form in formset.forms] will have the data in the correct
|
||||||
# order specified by the ordering fields. If a number is duplicated in the set
|
# order specified by the ordering fields. If a number is duplicated in the set
|
||||||
# of ordering fields, for instance form 0 and form 3 are both marked as 1, then
|
# of ordering fields, for instance form 0 and form 3 are both marked as 1, then
|
||||||
|
|
|
@ -10,6 +10,6 @@ class EmailBackend(BaseEmailBackend):
|
||||||
self.test_outbox = []
|
self.test_outbox = []
|
||||||
|
|
||||||
def send_messages(self, email_messages):
|
def send_messages(self, email_messages):
|
||||||
# Messages are stored in a instance variable for testing.
|
# Messages are stored in an instance variable for testing.
|
||||||
self.test_outbox.extend(email_messages)
|
self.test_outbox.extend(email_messages)
|
||||||
return len(email_messages)
|
return len(email_messages)
|
||||||
|
|
|
@ -1165,7 +1165,7 @@ class ModelFormsetTest(TestCase):
|
||||||
|
|
||||||
def test_inlineformset_factory_with_null_fk(self):
|
def test_inlineformset_factory_with_null_fk(self):
|
||||||
# inlineformset_factory tests with fk having null=True. see #9462.
|
# inlineformset_factory tests with fk having null=True. see #9462.
|
||||||
# create some data that will exbit the issue
|
# create some data that will exhibit the issue
|
||||||
team = Team.objects.create(name="Red Vipers")
|
team = Team.objects.create(name="Red Vipers")
|
||||||
Player(name="Timmy").save()
|
Player(name="Timmy").save()
|
||||||
Player(name="Bobby", team=team).save()
|
Player(name="Bobby", team=team).save()
|
||||||
|
|
|
@ -21,7 +21,7 @@ class Restaurant(Place):
|
||||||
|
|
||||||
|
|
||||||
class Manager(models.Model):
|
class Manager(models.Model):
|
||||||
retaurant = models.ForeignKey(Restaurant)
|
restaurant = models.ForeignKey(Restaurant)
|
||||||
name = models.CharField(max_length=50)
|
name = models.CharField(max_length=50)
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -69,7 +69,7 @@ class ModelInheritanceTests(TestCase):
|
||||||
# access to the fields of their ancestors.
|
# access to the fields of their ancestors.
|
||||||
# Create a couple of Places.
|
# Create a couple of Places.
|
||||||
Place.objects.create(name="Master Shakes", address="666 W. Jersey")
|
Place.objects.create(name="Master Shakes", address="666 W. Jersey")
|
||||||
Place.objects.create(name="Ace Harware", address="1013 N. Ashland")
|
Place.objects.create(name="Ace Hardware", address="1013 N. Ashland")
|
||||||
|
|
||||||
# Test constructor for Restaurant.
|
# Test constructor for Restaurant.
|
||||||
r = Restaurant.objects.create(
|
r = Restaurant.objects.create(
|
||||||
|
|
|
@ -165,7 +165,7 @@ class ModelInheritanceTest(TestCase):
|
||||||
serves_hot_dogs=True,
|
serves_hot_dogs=True,
|
||||||
serves_pizza=False)
|
serves_pizza=False)
|
||||||
|
|
||||||
# This should delete both Restuarants, plus the related places, plus
|
# This should delete both Restaurants, plus the related places, plus
|
||||||
# the ItalianRestaurant.
|
# the ItalianRestaurant.
|
||||||
Restaurant.objects.all().delete()
|
Restaurant.objects.all().delete()
|
||||||
|
|
||||||
|
|
|
@ -8,7 +8,7 @@ from .models.publication import Publication
|
||||||
from .models.article import Article
|
from .models.article import Article
|
||||||
|
|
||||||
|
|
||||||
class Advertisment(models.Model):
|
class Advertisement(models.Model):
|
||||||
customer = models.CharField(max_length=100)
|
customer = models.CharField(max_length=100)
|
||||||
publications = models.ManyToManyField(
|
publications = models.ManyToManyField(
|
||||||
"model_package.Publication", null=True, blank=True
|
"model_package.Publication", null=True, blank=True
|
||||||
|
@ -33,10 +33,10 @@ class ModelPackageTests(TestCase):
|
||||||
self.assertEqual(a.sites.count(), 1)
|
self.assertEqual(a.sites.count(), 1)
|
||||||
|
|
||||||
# Regression for #12245 - Models can exist in the test package, too
|
# Regression for #12245 - Models can exist in the test package, too
|
||||||
ad = Advertisment.objects.create(customer="Lawrence Journal-World")
|
ad = Advertisement.objects.create(customer="Lawrence Journal-World")
|
||||||
ad.publications.add(p)
|
ad.publications.add(p)
|
||||||
|
|
||||||
ad = Advertisment.objects.get(id=ad.pk)
|
ad = Advertisement.objects.get(id=ad.pk)
|
||||||
self.assertEqual(ad.publications.count(), 1)
|
self.assertEqual(ad.publications.count(), 1)
|
||||||
|
|
||||||
# Regression for #12386 - field names on the autogenerated intermediate
|
# Regression for #12386 - field names on the autogenerated intermediate
|
||||||
|
|
|
@ -624,7 +624,7 @@ class QueryTestCase(TestCase):
|
||||||
|
|
||||||
new_bob_profile = UserProfile(flavor="spring surprise")
|
new_bob_profile = UserProfile(flavor="spring surprise")
|
||||||
|
|
||||||
# assigning a profile requires a explicit pk as the object isn't saved
|
# assigning a profile requires an explicit pk as the object isn't saved
|
||||||
charlie = User(pk=51, username='charlie', email='charlie@example.com')
|
charlie = User(pk=51, username='charlie', email='charlie@example.com')
|
||||||
charlie.set_unusable_password()
|
charlie.set_unusable_password()
|
||||||
|
|
||||||
|
|
|
@ -1710,7 +1710,7 @@ class NullableRelOrderingTests(TestCase):
|
||||||
qs = qs.order_by('others__single__name')
|
qs = qs.order_by('others__single__name')
|
||||||
# The ordering by others__single__pk will add one new join (to single)
|
# The ordering by others__single__pk will add one new join (to single)
|
||||||
# and that join must be LEFT join. The already existing join to related
|
# and that join must be LEFT join. The already existing join to related
|
||||||
# objects must be kept INNER. So, we have both a INNER and a LEFT join
|
# objects must be kept INNER. So, we have both an INNER and a LEFT join
|
||||||
# in the query.
|
# in the query.
|
||||||
self.assertEqual(str(qs.query).count('LEFT'), 1)
|
self.assertEqual(str(qs.query).count('LEFT'), 1)
|
||||||
self.assertEqual(str(qs.query).count('INNER'), 1)
|
self.assertEqual(str(qs.query).count('INNER'), 1)
|
||||||
|
|
|
@ -386,7 +386,7 @@ class SyndicationFeedTest(FeedTestCase):
|
||||||
|
|
||||||
def test_item_link_error(self):
|
def test_item_link_error(self):
|
||||||
"""
|
"""
|
||||||
Test that a ImproperlyConfigured is raised if no link could be found
|
Test that an ImproperlyConfigured is raised if no link could be found
|
||||||
for the item(s).
|
for the item(s).
|
||||||
"""
|
"""
|
||||||
self.assertRaises(ImproperlyConfigured,
|
self.assertRaises(ImproperlyConfigured,
|
||||||
|
|
|
@ -405,7 +405,7 @@ class ClientTest(TestCase):
|
||||||
# TODO: Log in with right permissions and request the page again
|
# TODO: Log in with right permissions and request the page again
|
||||||
|
|
||||||
def test_view_with_permissions_exception(self):
|
def test_view_with_permissions_exception(self):
|
||||||
"Request a page that is protected with @permission_required but raises a exception"
|
"Request a page that is protected with @permission_required but raises an exception"
|
||||||
|
|
||||||
# Get the page without logging in. Should result in 403.
|
# Get the page without logging in. Should result in 403.
|
||||||
response = self.client.get('/permission_protected_view_exception/')
|
response = self.client.get('/permission_protected_view_exception/')
|
||||||
|
|
|
@ -373,7 +373,7 @@ class ReverseShortcutTests(TestCase):
|
||||||
|
|
||||||
def test_reverse_by_path_nested(self):
|
def test_reverse_by_path_nested(self):
|
||||||
# Views that are added to urlpatterns using include() should be
|
# Views that are added to urlpatterns using include() should be
|
||||||
# reversable by doted path.
|
# reversible by doted path.
|
||||||
self.assertEqual(reverse('urlpatterns_reverse.views.nested_view'), '/includes/nested_path/')
|
self.assertEqual(reverse('urlpatterns_reverse.views.nested_view'), '/includes/nested_path/')
|
||||||
|
|
||||||
def test_redirect_view_object(self):
|
def test_redirect_view_object(self):
|
||||||
|
@ -439,7 +439,7 @@ class NamespaceTests(TestCase):
|
||||||
self.assertEqual('/ns-included1/+%5C$*/', reverse('inc-ns1:inc-special-view'))
|
self.assertEqual('/ns-included1/+%5C$*/', reverse('inc-ns1:inc-special-view'))
|
||||||
|
|
||||||
def test_namespace_pattern_with_variable_prefix(self):
|
def test_namespace_pattern_with_variable_prefix(self):
|
||||||
"When using a include with namespaces when there is a regex variable in front of it"
|
"When using an include with namespaces when there is a regex variable in front of it"
|
||||||
self.assertEqual('/ns-outer/42/normal/', reverse('inc-outer:inc-normal-view', kwargs={'outer': 42}))
|
self.assertEqual('/ns-outer/42/normal/', reverse('inc-outer:inc-normal-view', kwargs={'outer': 42}))
|
||||||
self.assertEqual('/ns-outer/42/normal/', reverse('inc-outer:inc-normal-view', args=[42]))
|
self.assertEqual('/ns-outer/42/normal/', reverse('inc-outer:inc-normal-view', args=[42]))
|
||||||
self.assertEqual('/ns-outer/42/normal/37/4/', reverse('inc-outer:inc-normal-view', kwargs={'outer': 42, 'arg1': 37, 'arg2': 4}))
|
self.assertEqual('/ns-outer/42/normal/37/4/', reverse('inc-outer:inc-normal-view', kwargs={'outer': 42, 'arg1': 37, 'arg2': 4}))
|
||||||
|
|
Loading…
Reference in New Issue