Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6770525
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T15:19:22+00:00 2026-05-26T15:19:22+00:00

According to the Django testing docs, the Django client Response object contains ‘templates’, which

  • 0

According to the Django testing docs, the Django client Response object contains ‘templates’, which is: “A list of Template instances used to render the final content, in the order they were rendered. For each template in the list, use template.name to get the template’s file name, if the template was loaded from a file. (The name is a string such as ‘admin/index.html’.)”

However, I am getting an empty list of templates, even though I am confident that a template was rendered.

from django.test.client import Client
c = Client()
response = c.post('/signup/', {'email': 'a@b.com', 'password1': 'smith', 'password2': 'smith'}, follow=True)
print response.templates
# []

Why is templates empty? How do I see what template was rendered?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T15:19:23+00:00Added an answer on May 26, 2026 at 3:19 pm

    Have you tried your code in a interactive session? The Django documentation says:

    Although * your code * [+] would work in the Python interactive
    interpreter, some of the test client’s functionality, notably the
    template-related functionality, is only available while tests are
    running.
    The reason for this is that Django’s test runner performs a bit of
    black magic in order to determine which template was loaded by a given
    view. This black magic (essentially a patching of Django’s template
    system in memory) only happens during test running.

    So if you run it in a test run, it should work.

    [+] I have replaced the * the above example from the django documentation with your code * to make this snippet more readable.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

According to this section in the Django docs I should use {% blocktrans %}
I'm customizing django comments. According to the docs you'll need to add your customized
According to Django documentation I've registered my filter: from google.appengine.ext.webapp import template # ...
According to this thread on the django-developers list, I can't pass the constant False
According to this article Silverlight 2 Beta 2 supports the DataContractJsonSerializer object. But, when
Django 1.2 has brought in some changes in the syndication framework. According to this
I'm using django.views.generic.list_detail.object_detail. According to the documentation the view takes the variable object_id. To
According to The Django Book , Django's templating system supports nested dot lookups: Dot
According to the Documentation using the django.views.static.server() function is: inefficient and insecure. I understand
I'm trying to use Django transactions on MySQL with the commit_on_success decorator . According

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.