title: Context in Django HttpResponse
body: <p>I happen to pass by Django documentation for <code>TemplateResponse</code>. (My question is for <code>HttpResponse</code>)</p>
  
  <blockquote>
    <p>Unlike basic HttpResponse objects, TemplateResponse objects retain the details of the template and context that was provided by the view to compute the response.</p>
  </blockquote>
  
  <p>Here it says that <code>response</code> object which we get from <code>self.client.get()</code> which is an object of <code>HttpResponse</code>, does not retain the <code>context</code> provided by view.</p>
  
  <p>But when I did <code>dir(response)</code> I could find <code>context</code> there.</p>
  
  <p>Kindly explain me the actual meaning of documentation.</p>
  
  <p><strong>Edit 1 :</strong></p>
  
  <p>Here is one of the test method</p>
  
  <pre><code>def test_11(self):
          response = self.client.get(self.signupurl)
          print(response.context)
          print(response.context.keys())
          self.assertContains(response, 'href="{}"'.format(self.homeurl))
  </code></pre>
  
  <p>Here is the signup url declared</p>
  
  <pre><code>@classmethod
      def setUpTestData(cls):
          cls.signupurl = reverse('signup_url')
  </code></pre>
  
  <p>Here is output of <code>response.context</code></p>
  
  <pre><code>[[{'False': False, 'None': None, 'True': True}, {'perms': &lt;django.contrib.auth.context_processors.PermWrapper object at 0x000000E3FBFEB080&gt;, 'messages': &lt;django.contrib.messages.storage.fallback.FallbackStorage object at 0x000000E3FBFF0EB8&gt;, 'csrf_token': &lt;SimpleLazyObject: 'RtN0wMaL3mGQbZB3zaFjR7cNDtNLkFPvXlgigUt8582AJH2b6JYJ6d7V6UR3ZipA'&gt;, 'user': &lt;SimpleLazyObject: &lt;django.contrib.auth.models.AnonymousUser object at 0x000000E3FBFF0BA8&gt;&gt;, 'DEFAULT_MESSAGE_LEVELS': {'DEBUG': 10, 'ERROR': 40, 'WARNING': 30, 'INFO': 20, 'SUCCESS': 25}, 'request': &lt;WSGIRequest: GET '/user/signup/'&gt;}, {}, {'form': &lt;UserCreationForm bound=False, valid=Unknown, fields=(username;password1;password2)&gt;}], [{'False': False, 'None': None, 'True': True}, {'perms': &lt;django.contrib.auth.context_processors.PermWrapper object at 0x000000E3FBFEB080&gt;, 'messages': &lt;django.contrib.messages.storage.fallback.FallbackStorage object at 0x000000E3FBFF0EB8&gt;, 'csrf_token': &lt;SimpleLazyObject: 'RtN0wMaL3mGQbZB3zaFjR7cNDtNLkFPvXlgigUt8582AJH2b6JYJ6d7V6UR3ZipA'&gt;, 'user': &lt;SimpleLazyObject: &lt;django.contrib.auth.models.AnonymousUser object at 0x000000E3FBFF0BA8&gt;&gt;, 'DEFAULT_MESSAGE_LEVELS': {'DEBUG': 10, 'ERROR': 40, 'WARNING': 30, 'INFO': 20, 'SUCCESS': 25}, 'request': &lt;WSGIRequest: GET '/user/signup/'&gt;}, {}, {'form': &lt;UserCreationForm bound=False, valid=Unknown, fields=(username;password1;password2)&gt;}], [{'False': False, 'None': None, 'True': True}, {'perms': &lt;django.contrib.auth.context_processors.PermWrapper object at 0x000000E3FBFEB080&gt;, 'messages': &lt;django.contrib.messages.storage.fallback.FallbackStorage object at 0x000000E3FBFF0EB8&gt;, 'csrf_token': &lt;SimpleLazyObject: 'RtN0wMaL3mGQbZB3zaFjR7cNDtNLkFPvXlgigUt8582AJH2b6JYJ6d7V6UR3ZipA'&gt;, 'user': &lt;SimpleLazyObject: &lt;django.contrib.auth.models.AnonymousUser object at 0x000000E3FBFF0BA8&gt;&gt;, 'DEFAULT_MESSAGE_LEVELS': {'DEBUG': 10, 'ERROR': 40, 'WARNING': 30, 'INFO': 20, 'SUCCESS': 25}, 'request': &lt;WSGIRequest: GET '/user/signup/'&gt;}, {}, {'form': &lt;UserCreationForm bound=False, valid=Unknown, fields=(username;password1;password2)&gt;}, {'block': &lt;Block Node: content. Contents: [&lt;TextNode: '\n\t&lt;div class="w3-card-4 w'&gt;, &lt;django.template.defaulttags.CsrfTokenNode object at 0x000000E3FBFF4BE0&gt;, &lt;TextNode: '\n\t\t\t'&gt;, &lt;django.template.loader_tags.IncludeNode object at 0x000000E3FBFD2F60&gt;, &lt;TextNode: '\n\t\t\t&lt;button type="submit"'&gt;]&gt;}, {}], [{'False': False, 'None': None, 'True': True}, {'widget': {'type': 'text', 'is_hidden': False, 'attrs': {'maxlength': '150', 'required': True, 'id': 'id_username', 'autofocus': True}, 'name': 'username', 'required': True, 'value': None, 'template_name': 'django/forms/widgets/text.html'}}], [{'False': False, 'None': None, 'True': True}, {'widget': {'type': 'text', 'is_hidden': False, 'attrs': {'maxlength': '150', 'required': True, 'id': 'id_username', 'autofocus': True}, 'name': 'username', 'required': True, 'value': None, 'template_name': 'django/forms/widgets/text.html'}}, {}], [{'False': False, 'None': None, 'True': True}, {'widget': {'type': 'text', 'is_hidden': False, 'attrs': {'maxlength': '150', 'required': True, 'id': 'id_username', 'autofocus': True}, 'name': 'username', 'required': True, 'value': None, 'template_name': 'django/forms/widgets/text.html'}}, {}, {}], [{'False': False, 'None': None, 'True': True}, {'widget': {'type': 'password', 'is_hidden': False, 'attrs': {'required': True, 'id': 'id_password1'}, 'name': 'password1', 'required': True, 'value': None, 'template_name': 'django/forms/widgets/password.html'}}], [{'False': False, 'None': None, 'True': True}, {'widget': {'type': 'password', 'is_hidden': False, 'attrs': {'required': True, 'id': 'id_password1'}, 'name': 'password1', 'required': True, 'value': None, 'template_name': 'django/forms/widgets/password.html'}}, {}], [{'False': False, 'None': None, 'True': True}, {'widget': {'type': 'password', 'is_hidden': False, 'attrs': {'required': True, 'id': 'id_password1'}, 'name': 'password1', 'required': True, 'value': None, 'template_name': 'django/forms/widgets/password.html'}}, {}, {}], [{'False': False, 'None': None, 'True': True}, {'widget': {'type': 'password', 'is_hidden': False, 'attrs': {'required': True, 'id': 'id_password2'}, 'name': 'password2', 'required': True, 'value': None, 'template_name': 'django/forms/widgets/password.html'}}], [{'False': False, 'None': None, 'True': True}, {'widget': {'type': 'password', 'is_hidden': False, 'attrs': {'required': True, 'id': 'id_password2'}, 'name': 'password2', 'required': True, 'value': None, 'template_name': 'django/forms/widgets/password.html'}}, {}], [{'False': False, 'None': None, 'True': True}, {'widget': {'type': 'password', 'is_hidden': False, 'attrs': {'required': True, 'id': 'id_password2'}, 'name': 'password2', 'required': True, 'value': None, 'template_name': 'django/forms/widgets/password.html'}}, {}, {}]]
  </code></pre>
  
  <p>And here is output of <code>response.context.keys()</code></p>
  
  <pre><code>{'perms', 'block', 'user', 'False', 'DEFAULT_MESSAGE_LEVELS', 'form', 'widget', 'request', 'None', 'messages', 'csrf_token', 'True'}
  </code></pre>
  
  <p>Please note in above, <code>form</code> is the only value I have passed to <code>context</code> of <code>render</code> method for this url.</p>