mirror of
https://github.com/encode/django-rest-framework.git
synced 2025-08-04 20:40:14 +03:00
adding failing test for 405 on standard HTTP verbs with permissions
This commit is contained in:
parent
66e015c5ec
commit
266bde8abd
|
@ -209,6 +209,15 @@ class ModelPermissionsIntegrationTests(TestCase):
|
|||
response = instance_view(request, pk='1')
|
||||
self.assertEqual(response.status_code, status.HTTP_405_METHOD_NOT_ALLOWED)
|
||||
|
||||
def test_calling_standard_method_not_allowed(self):
|
||||
request = factory.delete('/', HTTP_AUTHORIZATION=self.permitted_credentials)
|
||||
response = root_view(request)
|
||||
self.assertEqual(response.status_code, status.HTTP_405_METHOD_NOT_ALLOWED)
|
||||
|
||||
request = factory.delete('/', HTTP_AUTHORIZATION=self.disallowed_credentials)
|
||||
response = root_view(request)
|
||||
self.assertEqual(response.status_code, status.HTTP_405_METHOD_NOT_ALLOWED)
|
||||
|
||||
|
||||
class BasicPermModel(models.Model):
|
||||
text = models.CharField(max_length=100)
|
||||
|
|
Loading…
Reference in New Issue
Block a user