bernardopires / django-tenant-schemas

Tenant support for Django using PostgreSQL schemas.
https://django-tenant-schemas.readthedocs.org/en/latest/
MIT License
1.45k stars 424 forks source link

Content-type argument is not used in TenantClient.delete #617

Open tartieret opened 4 years ago

tartieret commented 4 years ago

In test.client.TenantClient, the "content_type" argument for the delete function is not passed to super().delete. This prevents the use of a different content-type while testing:

def delete(self, path, data='', content_type='application/octet-stream',
               **extra):
        if 'HTTP_HOST' not in extra:
            extra['HTTP_HOST'] = self.tenant.domain_url
        return super(TenantClient, self).delete(path, data, **extra)

The correct function should be:

def delete(self, path, data='', **extra):
        if 'HTTP_HOST' not in extra:
            extra['HTTP_HOST'] = self.tenant.domain_url
        return super(TenantClient, self).delete(path, data, **extra)