mirror of
https://github.com/encode/django-rest-framework.git
synced 2025-08-04 20:40:14 +03:00
Merge 266bde8abd
into 99382f3ccb
This commit is contained in:
commit
fe0fb63814
|
@ -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