Commit 6ecadcbd authored by Adrian Holovaty's avatar Adrian Holovaty
Browse files

Made a bunch more edits up until [17418]

git-svn-id: http://code.djangoproject.com/svn/django/trunk@17428 bcc190cf-cafb-0310-a4f2-bffc1f526a37
parent 00227b65
Loading
Loading
Loading
Loading
+1 −4
Original line number Diff line number Diff line
@@ -80,10 +80,7 @@ class Sitemap(object):
                except Site.DoesNotExist:
                    pass
            if site is None:
                raise ImproperlyConfigured("In order to use Sitemaps "
                        "you must either use the sites framework "
                        "or pass in a Site or RequestSite object "
                        "in your view code.")
                raise ImproperlyConfigured("To use sitemaps, either enable the sites framework or pass a Site/RequestSite object in your view.")
        domain = site.domain

        urls = []
+15 −16
Original line number Diff line number Diff line
@@ -411,15 +411,14 @@ class SimpleTestCase(ut2.TestCase):

    def assertHTMLEqual(self, html1, html2, msg=None):
        """
        Asserts that two html snippets are semantically the same,
        e.g. whitespace in most cases is ignored, attribute ordering is not
        significant. The passed in arguments must be valid HTML.

        Asserts that two HTML snippets are semantically the same.
        Whitespace in most cases is ignored, and attribute ordering is not
        significant. The passed-in arguments must be valid HTML.
        """
        dom1 = assert_and_parse_html(self, html1, msg,
            u'First argument is not valid html:')
            u'First argument is not valid HTML:')
        dom2 = assert_and_parse_html(self, html2, msg,
            u'Second argument is not valid html:')
            u'Second argument is not valid HTML:')

        if dom1 != dom2:
            standardMsg = '%s != %s' % (
@@ -433,9 +432,9 @@ class SimpleTestCase(ut2.TestCase):
    def assertHTMLNotEqual(self, html1, html2, msg=None):
        """Asserts that two HTML snippets are not semantically equivalent."""
        dom1 = assert_and_parse_html(self, html1, msg,
            u'First argument is not valid html:')
            u'First argument is not valid HTML:')
        dom2 = assert_and_parse_html(self, html2, msg,
            u'Second argument is not valid html:')
            u'Second argument is not valid HTML:')

        if dom1 == dom2:
            standardMsg = '%s == %s' % (
@@ -625,9 +624,9 @@ class TransactionTestCase(SimpleTestCase):
        content = response.content
        if html:
            content = assert_and_parse_html(self, content, None,
                u"Response's content is not valid html:")
                u"Response's content is not valid HTML:")
            text = assert_and_parse_html(self, text, None,
                u"Second argument is not valid html:")
                u"Second argument is not valid HTML:")
        real_count = content.count(text)
        if count is not None:
            self.assertEqual(real_count, count,
@@ -661,9 +660,9 @@ class TransactionTestCase(SimpleTestCase):
        content = response.content
        if html:
            content = assert_and_parse_html(self, content, None,
                u'Response\'s content is no valid html:')
                u'Response\'s content is not valid HTML:')
            text = assert_and_parse_html(self, text, None,
                u'Second argument is no valid html:')
                u'Second argument is not valid HTML:')
        self.assertEqual(content.count(text), 0,
            msg_prefix + "Response should not contain '%s'" % text)

@@ -721,7 +720,7 @@ class TransactionTestCase(SimpleTestCase):
    def assertTemplateUsed(self, response=None, template_name=None, msg_prefix=''):
        """
        Asserts that the template with the provided name was used in rendering
        the response. Also useable as context manager.
        the response. Also usable as context manager.
        """
        if response is None and template_name is None:
            raise TypeError(u'response and/or template_name argument must be provided')
@@ -729,7 +728,7 @@ class TransactionTestCase(SimpleTestCase):
        if msg_prefix:
            msg_prefix += ": "

        # use assertTemplateUsed as context manager
        # Use assertTemplateUsed as context manager.
        if not hasattr(response, 'templates') or (response is None and template_name):
            if response:
                template_name = response
@@ -748,7 +747,7 @@ class TransactionTestCase(SimpleTestCase):
    def assertTemplateNotUsed(self, response=None, template_name=None, msg_prefix=''):
        """
        Asserts that the template with the provided name was NOT used in
        rendering the response. Also useable as context manager.
        rendering the response. Also usable as context manager.
        """
        if response is None and template_name is None:
            raise TypeError(u'response and/or template_name argument must be provided')
@@ -756,7 +755,7 @@ class TransactionTestCase(SimpleTestCase):
        if msg_prefix:
            msg_prefix += ": "

        # use assertTemplateUsed as context manager
        # Use assertTemplateUsed as context manager.
        if not hasattr(response, 'templates') or (response is None and template_name):
            if response:
                template_name = response
+2 −2
Original line number Diff line number Diff line
@@ -365,7 +365,7 @@ special: It's just a normal view.

You normally won't have to bother with writing 404 views. If you don't set
``handler404``, the built-in view :func:`django.views.defaults.page_not_found`
is used by default. In this case, you still have one obligation: To create a
is used by default. In this case, you still have one obligation: create a
``404.html`` template in the root of your template directory. The default 404
view will use that template for all 404 errors. If :setting:`DEBUG` is set to
``False`` (in your settings module) and if you didn't create a ``404.html``
+1 −1
Original line number Diff line number Diff line
@@ -310,7 +310,7 @@ index will reflect that.

.. versionadded:: 1.4

If you are not using the vanilla sitemap view -- for example, if it is wrapped
If you're not using the vanilla sitemap view -- for example, if it's wrapped
with a caching decorator -- you must name your sitemap view and pass
``sitemap_url_name`` to the index view::

+1 −1
Original line number Diff line number Diff line
@@ -1002,7 +1002,7 @@ For example::
.. versionadded:: 1.4

As with the :djadmin:`startapp` command, the ``--template`` option lets you
specify a directory, file path, or URL of a custom project template. See the
specify a directory, file path or URL of a custom project template. See the
:djadmin:`startapp` documentation for details of supported project template
formats.

Loading