Fixed #22261 -- Fixed resolving namespaced URLs for flatpages.

This commit is contained in:
Hasan Ramezani 2019-11-27 00:00:56 +01:00 committed by Mariusz Felisiak
parent e2fab0b679
commit 2633c5341e
5 changed files with 38 additions and 4 deletions

View file

@ -31,5 +31,8 @@ class FlatpagesSitemapTests(TestCase):
def test_flatpage_sitemap(self):
response = self.client.get('/flatpages/sitemap.xml')
self.assertIn(b'<url><loc>http://example.com/foo/</loc></url>', response.getvalue())
self.assertNotIn(b'<url><loc>http://example.com/private-foo/</loc></url>', response.getvalue())
self.assertIn(b'<url><loc>http://example.com/flatpage_root/foo/</loc></url>', response.getvalue())
self.assertNotIn(
b'<url><loc>http://example.com/flatpage_root/private-foo/</loc></url>',
response.getvalue(),
)