예제 #1
0
    def test_should_prepare_head_request(self):

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

        factory = RequestFactory()
        request = factory.post('/')
        self.assertEqual(request.method, 'POST')
예제 #5
0
    def test_should_prepare_get_request_with_params(self):

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

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

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

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