diff options
| author | Aymeric Augustin <aymeric.augustin@m4x.org> | 2012-08-14 11:57:18 +0200 |
|---|---|---|
| committer | Aymeric Augustin <aymeric.augustin@m4x.org> | 2012-08-14 12:29:53 +0200 |
| commit | faf570df187bc82a3bcffa5613165a6e6cc56a57 (patch) | |
| tree | cb4e54d2b5e74ede9abad909c9c2851a2bd674ce /django/contrib/sitemaps/tests/https.py | |
| parent | d1452f60974da6f0e54ff9ad7a03d2c115675d10 (diff) | |
[py3] Compared response.content with bytes.
Diffstat (limited to 'django/contrib/sitemaps/tests/https.py')
| -rw-r--r-- | django/contrib/sitemaps/tests/https.py | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/django/contrib/sitemaps/tests/https.py b/django/contrib/sitemaps/tests/https.py index d4f9053fc8..34d992fc78 100644 --- a/django/contrib/sitemaps/tests/https.py +++ b/django/contrib/sitemaps/tests/https.py @@ -1,3 +1,5 @@ +from __future__ import unicode_literals + from datetime import date from django.test.utils import override_settings @@ -11,7 +13,7 @@ class HTTPSSitemapTests(SitemapTestsBase): def test_secure_sitemap_index(self): "A secure sitemap index can be rendered" response = self.client.get('/secure/index.xml') - self.assertEqual(response.content, """<?xml version="1.0" encoding="UTF-8"?> + self.assertEqual(response.content, b"""<?xml version="1.0" encoding="UTF-8"?> <sitemapindex xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"> <sitemap><loc>%s/secure/sitemap-simple.xml</loc></sitemap> </sitemapindex> @@ -20,7 +22,7 @@ class HTTPSSitemapTests(SitemapTestsBase): def test_secure_sitemap_section(self): "A secure sitemap section can be rendered" response = self.client.get('/secure/sitemap-simple.xml') - self.assertEqual(response.content, """<?xml version="1.0" encoding="UTF-8"?> + self.assertEqual(response.content, b"""<?xml version="1.0" encoding="UTF-8"?> <urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"> <url><loc>%s/location/</loc><lastmod>%s</lastmod><changefreq>never</changefreq><priority>0.5</priority></url> </urlset> @@ -34,7 +36,7 @@ class HTTPSDetectionSitemapTests(SitemapTestsBase): def test_sitemap_index_with_https_request(self): "A sitemap index requested in HTTPS is rendered with HTTPS links" response = self.client.get('/simple/index.xml', **self.extra) - self.assertEqual(response.content, """<?xml version="1.0" encoding="UTF-8"?> + self.assertEqual(response.content, b"""<?xml version="1.0" encoding="UTF-8"?> <sitemapindex xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"> <sitemap><loc>%s/simple/sitemap-simple.xml</loc></sitemap> </sitemapindex> @@ -43,7 +45,7 @@ class HTTPSDetectionSitemapTests(SitemapTestsBase): def test_sitemap_section_with_https_request(self): "A sitemap section requested in HTTPS is rendered with HTTPS links" response = self.client.get('/simple/sitemap-simple.xml', **self.extra) - self.assertEqual(response.content, """<?xml version="1.0" encoding="UTF-8"?> + self.assertEqual(response.content, b"""<?xml version="1.0" encoding="UTF-8"?> <urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"> <url><loc>%s/location/</loc><lastmod>%s</lastmod><changefreq>never</changefreq><priority>0.5</priority></url> </urlset> |
