I want to test that /sitemap.xml/
redirects to /sitemap.xml
. I'm using this code:
res = self.client.get('/sitemap.xml/')
self.assertRedirects(res, '/sitemap.xml', status_code=301)
And getting the following error:
AssertionError: Response redirected to 'http://testserver/sitemap.xml', expected '/sitemap.xml'
How should I write this test to avoid the testserver
clash?