Using a view might be okay, but the issue here is the test:
```python
# There is a chance of missing a cache since it's updated by the cron.
# We can force generating a cache, but it takes a while...
if not doc('url'):
    response = self.client.get('/sitemap.xml', {'locale': 'en-US'},
                               HTTP_CACHE_CONTROL='no-cache')
    doc = pq(response.content, parser='html')
    ok_(doc('url'))
```
This is the problematic part.

To prevent potential DoS attacks, I could add a check for the server name:
```python
if (self.request.META.get('SERVER_NAME', '') == 'testserver' and
        'no-cache' in self.request.META.get('HTTP_CACHE_CONTROL', '')):
```