diff options
| author | Arthur Jovart <arthur@jovart.com> | 2021-04-14 14:50:01 +0200 |
|---|---|---|
| committer | Carlton Gibson <carlton.gibson@noumenal.es> | 2021-04-14 19:44:10 +0200 |
| commit | 65dfb06a1ab56c238cc80f5e1c31f61210c4577d (patch) | |
| tree | 9cf57c9a3edc7a07960bd4c1710096db8976f303 /tests | |
| parent | 59cce8237c9efb33f16058bac67702d5a11ea1d9 (diff) | |
[3.2.x] Fixed #32648 -- Fixed VariableDoesNotExist rendering sitemaps template.
Backport of 08c60cce3b13f6e60d7588206da2d3c71228f378 from main
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/sitemaps_tests/test_http.py | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/tests/sitemaps_tests/test_http.py b/tests/sitemaps_tests/test_http.py index b546c87fe6..021feb7ad8 100644 --- a/tests/sitemaps_tests/test_http.py +++ b/tests/sitemaps_tests/test_http.py @@ -255,9 +255,12 @@ class HTTPSitemapTests(SitemapTestsBase): @override_settings(LANGUAGES=(('en', 'English'), ('pt', 'Portuguese'))) def test_simple_i18n_sitemap_index(self): """ - A simple i18n sitemap index can be rendered. + A simple i18n sitemap index can be rendered, without logging variable + lookup errors. """ - response = self.client.get('/simple/i18n.xml') + with self.assertRaisesMessage(AssertionError, 'no logs'): + with self.assertLogs('django.template', 'DEBUG'): + response = self.client.get('/simple/i18n.xml') expected_content = """<?xml version="1.0" encoding="UTF-8"?> <urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9" xmlns:xhtml="http://www.w3.org/1999/xhtml"> <url><loc>{0}/en/i18n/testmodel/{1}/</loc><changefreq>never</changefreq><priority>0.5</priority></url><url><loc>{0}/pt/i18n/testmodel/{1}/</loc><changefreq>never</changefreq><priority>0.5</priority></url> |
