Ticket #18048: test_patch.diff

File test_patch.diff, 2.1 KB (added by Johan Sommerfeld <johan@…>, 13 years ago)

tests showing problem

  • tests/regressiontests/test_client_regress/models.py

    diff --git a/tests/regressiontests/test_client_regress/models.py b/tests/regressiontests/test_client_regress/models.py
    a b  
    800800        self.assertEqual(response.status_code, 200)
    801801        self.assertEqual(response.content, 'request method: PUT')
    802802
     803    def test_get(self):
     804        "Request a view with string data via request method get"
     805        # Regression test for #18048
     806        data = u'{"test": "json"}'
     807        response = self.client.get('/test_client_regress/request_methods/', data=data, content_type='application/json')
     808        self.assertEqual(response.status_code, 200)
     809        self.assertEqual(response.content, 'request method: GET')
     810
     811    def test_head(self):
     812        "Request a view with string data via request method head"
     813        # Regression test for #18048
     814        data = u'{"test": "json"}'
     815        response = self.client.head('/test_client_regress/request_methods/', data=data, content_type='application/json')
     816        self.assertEqual(response.status_code, 200)
     817        self.assertEqual(response.content, 'request method: HEAD')
     818
     819    def test_options(self):
     820        "Request a view with string data via request method options"
     821        # Regression test for #18048
     822        data = u'{"test": "json"}'
     823        response = self.client.options('/test_client_regress/request_methods/', data=data, content_type='application/json')
     824        self.assertEqual(response.status_code, 200)
     825        self.assertEqual(response.content, 'request method: OPTIONS')
     826
     827    def test_delete(self):
     828        "Request a view with string data via request method DELETE"
     829        # Regression test for #18048
     830        data = u'{"test": "json"}'
     831        response = self.client.delete('/test_client_regress/request_methods/', data=data, content_type='application/json')
     832        self.assertEqual(response.status_code, 200)
     833        self.assertEqual(response.content, 'request method: DELETE')
     834
    803835class QueryStringTests(TestCase):
    804836    def test_get_like_requests(self):
    805837        # See: https://code.djangoproject.com/ticket/10571.
Back to Top