django.utils.six.moves.http_client.NOT_FOUND

Here are the examples of the python api django.utils.six.moves.http_client.NOT_FOUND taken from open source projects. By voting up you can indicate which examples are most useful and appropriate.

5 Examples 7

Example 1

View license
    def test_users_cannot_force_an_other_custumer_order(self):
        self.add_product_to_basket()
        self.enter_shipping_address()
        self.place_order()
        user = self.create_user('John', '[email protected]')
        user.save()
        order = Order.objects.get()

        test_url = '%s?order_number=%s' % (
            reverse('checkout:thank-you'), order.number)
        response = self.get(test_url, status='*', user=user)
        self.assertEqual(response.status_code, http_client.NOT_FOUND)

        test_url = '%s?order_id=%s' % (reverse('checkout:thank-you'), order.pk)
        response = self.get(test_url, status='*', user=user)
        self.assertEqual(response.status_code, http_client.NOT_FOUND)

Example 2

Project: django-oscar
Source File: order_status_tests.py
View license
    def test_gets_404_when_using_incorrect_hash(self):
        order = create_order()
        path = reverse('customer:anon-order',
                       kwargs={'order_number': order.number,
                               'hash': 'bad'})
        response = self.app.get(path, status="*")
        self.assertEqual(http_client.NOT_FOUND, response.status_code)

Example 3

Project: django-oscar
Source File: testcases.py
View license
    def assertNoAccess(self, response):
        self.assertContext(response)
        self.assertTrue(response.status_code in (http_client.NOT_FOUND,
                                                 http_client.FORBIDDEN))

Example 4

View license
    def tests_gets_a_404_when_there_is_no_order(self):
        response = self.get(
            reverse('checkout:thank-you'), user=self.user, status="*")
        self.assertEqual(http_client.NOT_FOUND, response.status_code)

Example 5

Project: django-oscar
Source File: order_status_tests.py
View license
    def test_gets_a_404_when_requesting_an_unknown_order(self):
        path = reverse('customer:anon-order', kwargs={'order_number': 1000,
                                                      'hash': '1231231232'})
        response = self.app.get(path, status="*")
        self.assertEqual(http_client.NOT_FOUND, response.status_code)