mirror of
https://github.com/encode/django-rest-framework.git
synced 2025-07-27 08:29:59 +03:00
Add SafeString yaml rendering test
This commit is contained in:
parent
1aad0371e0
commit
ed3baea398
|
@ -5,6 +5,7 @@ import pytest
|
|||
from django.db import models
|
||||
from django.test import RequestFactory, TestCase, override_settings
|
||||
from django.urls import path
|
||||
from django.utils.safestring import SafeString
|
||||
from django.utils.translation import gettext_lazy as _
|
||||
|
||||
from rest_framework import filters, generics, pagination, routers, serializers
|
||||
|
@ -569,6 +570,11 @@ class TestOperationIntrospection(TestCase):
|
|||
renderer.render(data) == b'o2:\n test: test\no1:\n test: test\n' # py <= 3.5
|
||||
)
|
||||
|
||||
def test_openapi_yaml_safestring_render(self):
|
||||
renderer = OpenAPIRenderer()
|
||||
data = {'o1': SafeString('test')}
|
||||
assert renderer.render(data) == b'o1: test\n'
|
||||
|
||||
def test_serializer_filefield(self):
|
||||
path = '/{id}/'
|
||||
method = 'POST'
|
||||
|
|
Loading…
Reference in New Issue
Block a user