title: Writing a unit test for a DJANGO view
body: <p>Hi i am new in DJANGO and I have problems understanding how the unit tests should be designed for django.
  Please help me design a unit test case for following view.</p>
  
  <pre><code>def camera_gallery(request,gallery_id=None):
          #endpoint is url from where i get JSON data
      endpoint = settings.GALLERYAPI+'?galleryId='+ gallery_id+'&amp;api_key=' + settings.GALLERY_API_KEY
  
      response = requests.get(endpoint)
      if response.status_code == 200:
          json_response = json.loads(response.content)
          context = json_response
      else:
          raise Http404
      return render(request, 'app/gallery_secondary.html',context)
  </code></pre>