def render(request, template_name, context=None, content_type=None, status=None, using=None, **kwargs): """ Test-compatible render(). """ response = orig_render(request, template_name, context=context, content_type=content_type, status=status, using=using, **kwargs) if TEST and not content_type: from tests.utils import test_content content = response.content if DUMP_PATH: # pragma: no cover filename = '{:05d}-{}'.format(OUTPUT_COUNTER.increment(), template_name) with open(join(DUMP_PATH, filename), 'wb') as outfile: outfile.write(content) test_content(response.content) return response
def render( request, template_name, context=None, content_type=None, status=None, using=None, **kwargs): """ Test-compatible render(). """ response = orig_render( request, template_name, context=context, content_type=content_type, status=status, using=using, **kwargs) if TEST and not content_type: from tests.utils import test_content content = response.content if DUMP_PATH: # pragma: no cover filename = '{:05d}-{}'.format(OUTPUT_COUNTER.increment(), template_name) with open(join(DUMP_PATH, filename), 'wb') as outfile: outfile.write(content) test_content(response.content) return response
def render(*args, **kwargs): if 'context' in kwargs: kwargs['dictionary'] = kwargs.pop('context') return orig_render(*args, **kwargs)
def render(*args, **kwargs): from django.shortcuts import render as orig_render return orig_render(*args, **kwargs)