def test_410_redirect(self):
Redirect.objects.create(
site=self.site,
old_path=str(self.page1.get_absolute_url()),
new_path='/en/',
response_code='410',
)
client = Client()
response = client.get('/en/test-page/')
self.assertEqual(response.status_code, 410)
Redirect.objects.create(
site=self.site,
old_path='/some-path/',
response_code='302'
)
response2 = client.get('/some-path/')
self.assertEqual(response2.status_code, 410)
评论列表
文章目录