Here are the examples of the python api django.utils.six.moves.http_client.MOVED_PERMANENTLY taken from open source projects. By voting up you can indicate which examples are most useful and appropriate.
2 Examples
3
Example 1
def test_enforces_canonical_url(self):
p = create_product()
kwargs = {'product_slug': '1_wrong-but-valid-slug_1',
'pk': p.id}
wrong_url = reverse('catalogue:detail', kwargs=kwargs)
response = self.app.get(wrong_url)
self.assertEqual(http_client.MOVED_PERMANENTLY, response.status_code)
self.assertTrue(p.get_absolute_url() in response.location)
3
Example 2
def test_enforces_canonical_url(self):
kwargs = {'category_slug': '1_wrong-but-valid-slug_1',
'pk': self.category.pk}
wrong_url = reverse('catalogue:category', kwargs=kwargs)
response = self.app.get(wrong_url)
self.assertEqual(http_client.MOVED_PERMANENTLY, response.status_code)
self.assertTrue(self.category.get_absolute_url() in response.location)