diff --git a/django/contrib/sitemaps/tests/base.py b/django/contrib/sitemaps/tests/base.py index 54446b30121..a218e60c3e3 100644 --- a/django/contrib/sitemaps/tests/base.py +++ b/django/contrib/sitemaps/tests/base.py @@ -39,4 +39,4 @@ class SitemapTestsBase(TestCase): cache.clear() # Create an object for sitemap content. TestModel.objects.create(name='Test Object') - I18nTestModel.objects.create(name='Test Object') + self.i18n_model = I18nTestModel.objects.create(name='Test Object') diff --git a/django/contrib/sitemaps/tests/test_http.py b/django/contrib/sitemaps/tests/test_http.py index bce276d2eaa..c3c5767d492 100644 --- a/django/contrib/sitemaps/tests/test_http.py +++ b/django/contrib/sitemaps/tests/test_http.py @@ -178,7 +178,7 @@ class HTTPSitemapTests(SitemapTestsBase): response = self.client.get('/simple/i18n.xml') expected_content = """ -{0}/en/i18n/testmodel/1/never0.5{0}/pt/i18n/testmodel/1/never0.5 +{0}/en/i18n/testmodel/{1}/never0.5{0}/pt/i18n/testmodel/{1}/never0.5 -""".format(self.base_url) +""".format(self.base_url, self.i18n_model.pk) self.assertXMLEqual(response.content.decode('utf-8'), expected_content)