title: How to test checked radio button from views.py?
body: <p>I have a django project where my home page contains radio button which gives me the opprtunity to go to to another application or to show a message .I think that my test of button checked is not written correctly .
  log/views.py</p>
  
  <pre><code>from django.shortcuts import render
  from django.contrib.auth.decorators import login_required,user_passes_test
  from aps import views
  from django.http import HttpResponse
  
  @login_required()
  def home(request):
      if request.user.is_superuser:
          return render(request,"home.html") 
          if ('choix1').checked  in request.POST:
              return HttpResponse("hedha lmail")
          elif 'choix2'  in request.POST:
              return HttpResponse("hedha ltemps")
          elif 'choix3'  in request.POST:
              return views.index(request)
          else :
              return HttpResponse("You have not chosenn ay choice")
      else:
          return views.index(request)
  </code></pre>
  
  <p>home.html</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>{% extends 'base.html' %}
  
  {% block content %}
  &lt;div class="container"&gt;
      &lt;div class="row"&gt;
          &lt;div class="jumbotron"&gt;
              &lt;h1&gt;Hello&lt;/h1&gt;
              &lt;p&gt;You are on your account&lt;/p&gt;
  
          &lt;/div&gt;
          &lt;div class="jumbotron"&gt;
              
  &lt;FORM&gt;
  &lt;p&gt;you have the opprtunity to : &lt;/P&gt;
  &lt;INPUT type= "radio" name="choix1" id="choix1" value="mail"&gt; change mail sender
  &lt;INPUT type= "radio" name="choix2" id="choix2" value="temps"&gt; change frequency of getting temperqture sensor's value
  &lt;INPUT type= "radio" name="choix3" id="choix3" value="graph"&gt; show graph  &lt;br&gt;
  &lt;INPUT type= "submit" value="ok"&gt; 
  &lt;/FORM&gt;
          &lt;/div&gt;
      &lt;/div&gt;
  &lt;/div&gt;
  
  {% endblock %}</code></pre>
  </div>
  </div>
  </p>