(
self,
data,
encoder=DjangoJSONEncoder,
safe=True,
json_dumps_params=None,
**kwargs,
)
| 749 | """ |
| 750 | |
| 751 | def __init__( |
| 752 | self, |
| 753 | data, |
| 754 | encoder=DjangoJSONEncoder, |
| 755 | safe=True, |
| 756 | json_dumps_params=None, |
| 757 | **kwargs, |
| 758 | ): |
| 759 | if safe and not isinstance(data, dict): |
| 760 | raise TypeError( |
| 761 | "In order to allow non-dict objects to be serialized set the " |
| 762 | "safe parameter to False." |
| 763 | ) |
| 764 | if json_dumps_params is None: |
| 765 | json_dumps_params = {} |
| 766 | kwargs.setdefault("content_type", "application/json") |
| 767 | data = json.dumps(data, cls=encoder, **json_dumps_params) |
| 768 | super().__init__(content=data, **kwargs) |
nothing calls this directly
no test coverage detected