Ejemplo n.º 1
0
    def test_should_prepare_head_request(self):

        factory = RequestFactory()
        request = factory.head('/')
        self.assertEqual(request.method, 'HEAD')
Ejemplo n.º 2
0
    def test_should_prepare_post_request_with_content_type(self):

        factory = RequestFactory()
        request = factory.post('/', content_type='application/json')
        self.assertEqual(request.method, 'POST')
Ejemplo n.º 3
0
    def test_should_prepare_post_request_with_content_type_and_encodint(self):

        factory = RequestFactory()
        request = factory.post('/', content_type='text/plain; charset=UTF-8')
        self.assertEqual(request.method, 'POST')
Ejemplo n.º 4
0
    def test_should_prepare_post_request(self):

        factory = RequestFactory()
        request = factory.post('/')
        self.assertEqual(request.method, 'POST')
Ejemplo n.º 5
0
    def test_should_prepare_get_request_with_params(self):

        factory = RequestFactory()
        request = factory.get('/abc;type=json')
        self.assertEqual(request.method, 'GET')
Ejemplo n.º 6
0
    def test_should_prepare_get_request(self):

        factory = RequestFactory()
        request = factory.get('/')
        self.assertEqual(request.method, 'GET')
Ejemplo n.º 7
0
    def test_should_prepare_delete_request(self):

        factory = RequestFactory()
        request = factory.delete('/')
        self.assertEqual(request.method, 'DELETE')
Ejemplo n.º 8
0
    def test_should_prepare_options_request(self):

        factory = RequestFactory()
        request = factory.options('/')
        self.assertEqual(request.method, 'OPTIONS')