Esempio n. 1
0
    def test_should_prepare_head_request(self):

        factory = RequestFactory()
        request = factory.head('/')
        self.assertEqual(request.method, 'HEAD')
Esempio 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')
Esempio 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')
Esempio n. 4
0
    def test_should_prepare_post_request(self):

        factory = RequestFactory()
        request = factory.post('/')
        self.assertEqual(request.method, 'POST')
Esempio 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')
Esempio n. 6
0
    def test_should_prepare_get_request(self):

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

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

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