Loading django/contrib/sitemaps/__init__.py +1 −4 Original line number Diff line number Diff line Loading @@ -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 = [] Loading django/test/testcases.py +15 −16 Original line number Diff line number Diff line Loading @@ -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' % ( Loading @@ -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' % ( Loading Loading @@ -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, Loading Loading @@ -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) Loading Loading @@ -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') Loading @@ -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 Loading @@ -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') Loading @@ -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 Loading docs/intro/tutorial03.txt +2 −2 Original line number Diff line number Diff line Loading @@ -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`` Loading docs/ref/contrib/sitemaps.txt +1 −1 Original line number Diff line number Diff line Loading @@ -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:: Loading docs/ref/django-admin.txt +1 −1 Original line number Diff line number Diff line Loading @@ -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 Loading
django/contrib/sitemaps/__init__.py +1 −4 Original line number Diff line number Diff line Loading @@ -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 = [] Loading
django/test/testcases.py +15 −16 Original line number Diff line number Diff line Loading @@ -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' % ( Loading @@ -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' % ( Loading Loading @@ -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, Loading Loading @@ -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) Loading Loading @@ -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') Loading @@ -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 Loading @@ -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') Loading @@ -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 Loading
docs/intro/tutorial03.txt +2 −2 Original line number Diff line number Diff line Loading @@ -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`` Loading
docs/ref/contrib/sitemaps.txt +1 −1 Original line number Diff line number Diff line Loading @@ -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:: Loading
docs/ref/django-admin.txt +1 −1 Original line number Diff line number Diff line Loading @@ -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