def check_direct_to_template(prefix, pattern):
    from django import test
    from django.core.urlresolvers import reverse
    client = test.Client()
    response = client.get(reverse(prefix + ':' + pattern.name))
    template_name = pattern.default_args['template']
    template_names = [t.name for t in test.testcases.to_list(response.template)]
    ok_(template_names)
    ok_(template_name in template_names,
        "Template '%s' was not a template used to render"
        " the response. Actual template(s) used: %s" %
            (template_name, u', '.join(template_names)))
dataset/ETHPy150Open bueda/django-comrade/comrade/core/tests.py/check_direct_to_template/original