<s> from __future__ import absolute_import , unicode_literals <EOL> from django import forms <EOL> from django . conf import settings <EOL> from django . test . client import RequestFactory <EOL> from django . template import loader , Template <EOL> from drf_toolbox . renderers import APIRenderer <EOL> from rest_framework import generics , serializers , viewsets <EOL> from rest_framework . renderers import BrowsableAPIRenderer <EOL> from rest_framework . request import Request <EOL> from tests . compat import mock <EOL> import unittest <EOL> class RendererTests ( unittest . TestCase ) : <EOL> """<STR_LIT>""" <EOL> def setUp ( self ) : <EOL> self . request = Request ( RequestFactory ( ) . get ( '<STR_LIT>' ) ) <EOL> self . renderer = APIRenderer ( ) <EOL> self . renderer . accepted_media_type = '<STR_LIT>' <EOL> self . renderer . renderer_context = { <EOL> '<STR_LIT>' : self . request , <EOL> } <EOL> def test_render_method ( self ) : <EOL> """<STR_LIT>""" <EOL> with mock . patch . object ( settings , '<STR_LIT>' , <EOL> create = True , new = '<STR_LIT>' ) : <EOL> with mock . patch . object ( BrowsableAPIRenderer , '<STR_LIT>' ) as m : <EOL> self . renderer . render ( '<STR_LIT:foo>' , '<STR_LIT:application/json>' , { } ) <EOL> m . assert_called_with ( '<STR_LIT:foo>' , '<STR_LIT:application/json>' , { <EOL> '<STR_LIT:version>' : '<STR_LIT>' , <EOL> } ) </s>
