#15753: test_simple_sitemap fails after executing test_requestsite_sitemap when Sites app and FetchFromCacheMiddleware are installed. -------------------+--------------------------------- Reporter: lucho | Owner: nobody Type: Bug | Status: new Milestone: | Component: contrib.sitemaps Version: 1.3 | Severity: Normal Keywords: | Triage Stage: Unreviewed Has patch: 0 | -------------------+--------------------------------- test_simple_sitemap fails after executing test_requestsite_sitemap when Sites app and FetchFromCacheMiddleware are installed.
The error: {{{ ====================================================================== FAIL: test_simple_sitemap (django.contrib.sitemaps.tests.basic.SitemapTests) A simple sitemap can be rendered ---------------------------------------------------------------------- Traceback (most recent call last): File "/usr/local/lib/python2.6/dist- packages/Django-1.3-py2.6.egg/django/contrib/sitemaps/tests/basic.py", line 70, in test_simple_sitemap """ % (self.base_url, date.today().strftime('%Y-%m-%d'))) AssertionError: '<?xml version="1.0" encoding="UTF-8"?>\n<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">\n<url><loc>http://testserver/location/</loc><lastmod>2011-04-04</lastmod><changefreq>never</changefreq><priority>0.5</priority></url>\n</urlset>\n' != '<?xml version="1.0" encoding="UTF-8"?>\n<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">\n<url><loc>http://example.com/location/</loc><lastmod>2011-04-04</lastmod><changefreq>never</changefreq><priority>0.5</priority></url>\n</urlset>\n' }}} The way to reproduce it: 1. Use Sites app in your project 2. Use FetchFromCacheMiddleware middleware in your project 3. Run the sitemaps.SitemapTests suite The code that triggers the problem is this [http://code.djangoproject.com/browser/django/trunk/django/contrib/sitemaps/tests/basic.py#L144] {{{ # Which does that - setting the Site app as not installed and requesting the url Site._meta.installed = False response = self.client.get('/simple/sitemap.xml') }}} If I execute the test case separate (./manage.py test sitemaps.SitemapTests.test_simple_sitemap) no error is observed, but executing the whole test suite leads to error in test_simple_sitemap which is executed right after the test_requestsite_sitemap. If I comment out the test_requestsite_sitemap, no problem is observed. If I '''don't use (comment out) FetchFromCacheMiddleware''', no problem is observed. This makes me think that it is some problem related to caching. -- Ticket URL: <http://code.djangoproject.com/ticket/15753> Django <http://code.djangoproject.com/> The Web framework for perfectionists with deadlines. -- You received this message because you are subscribed to the Google Groups "Django updates" group. To post to this group, send email to django-updates@googlegroups.com. To unsubscribe from this group, send email to django-updates+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-updates?hl=en.