コード例 #1
0
    def test_schemajs_output(self):
        """
        Test output of the SchemaJS renderer as per #5608. Django 2.0 on Py3 prints binary data as b'xyz' in templates,
        and the base64 encoding used by SchemaJSRenderer outputs base64 as binary. Test fix.
        """
        factory = APIRequestFactory()
        request = factory.get('/')

        renderer = SchemaJSRenderer()

        output = renderer.render('data', renderer_context={"request": request})
        assert "'ImRhdGEi'" in output
        assert "'b'ImRhdGEi''" not in output
コード例 #2
0
    def test_schemajs_output(self):
        """
        Test output of the SchemaJS renderer as per #5608. Django 2.0 on Py3 prints binary data as b'xyz' in templates,
        and the base64 encoding used by SchemaJSRenderer outputs base64 as binary. Test fix.
        """
        factory = APIRequestFactory()
        request = factory.get('/')

        renderer = SchemaJSRenderer()

        output = renderer.render('data', renderer_context={"request": request})
        assert "'ImRhdGEi'" in output
        assert "'b'ImRhdGEi''" not in output