title: Django Testing: AttributeError: 'Client' object has no attribute 'get'
body: <p>I am new to Django framework &amp; I am trying write some tests for my apps in the project.Currently I have two apps <code>hoardings</code> &amp; <code>clients</code> both have same basic CRUD features.For testing purpose I have created a test directory &amp; it looks like this</p>
  <pre><code>clients
   - tests
    -__init__.py
    - test_views.py
  </code></pre>
  <p>That's how I am maintaining my tests for both the apps.My test_views.py has following code,</p>
  <pre><code>from django.test import TestCase
  from django.urls import reverse
  from hoardings.models import State, City
  from clients.models import Client
  
  
  class ClientManagementTest(TestCase):
  
      def setUp(self):
  
          self.state = State.objects.create(desc='West Bengal')
  
          self.city = City.objects.create(state=self.state, desc='Kolkata')
  
          self.client = Client()
  
      def test_client_creation_form_can_be_rendered(self):
  
          response = self.client.get(reverse('clients:create'))
  
          # Check that the response is 200 OK.
          self.assertEqual(response.status_code, 200)
  
          # check if csrf token is present
          self.assertContains(response, 'csrfmiddlewaretoken')
  
          # Check that the response contains a form.
          self.assertContains(response, '&lt;form')
  
          # assert the context values
          self.assertIn('url', response.context)
          self.assertIn('heading', response.context)
          self.assertIn('states', response.context)
          self.assertIn('client_types', response.context)
  </code></pre>
  <p>As you can see in the setup method I am creating an object of <code>Client</code> which is used to send the request.But every time I run the tests I get following errors,</p>
  <blockquote>
  <p>ERROR: test_client_creation_form_can_be_rendered
  (tests.test_views.ClientManagementTest)
  ---------------------------------------------------------------------- Traceback (most recent call last): File
  &quot;/home/ropali/Development/PythonWorkspace/hms_venv/hms/clients/tests/test_views.py&quot;,
  line 19, in test_client_creation_form_can_be_rendered response =
  self.client.get(reverse('clients:create')) AttributeError: 'Client'
  object has no attribute 'get'</p>
  </blockquote>
  <p>As per my understanding It means that client object is not being created so it cannot find the get attribute &amp; I get the similar error for the POST request as well.
  But one thing is bugging me that I have similar test setup for the <code>hoardings</code> app it runs perfectly fine.
  Can anyone please help me what I am doing wrong here.Let me know if you need other details.</p>