title: When I run test cases I get this error: psycopg2.OperationalError: cursor "_django_curs_140351416325888_23" does not exist
body: <p><strong>I'm trying to run test cases, but I get below error.</strong></p>
  <p><strong>Run command</strong> : <code>python manage.py test</code></p>
  <pre><code>Type 'yes' if you would like to try deleting the test database 'test_project_management_db', or 'no' to cancel: yes
  Destroying old test database for alias 'default'...
  
  Traceback (most recent call last):
    File &quot;manage.py&quot;, line 24, in &lt;module&gt;
      execute_from_command_line(sys.argv)
    File &quot;/home/rails/Desktop/projects/envs/project_manage_env/local/lib/python2.7/site-packages/django/core/management/__init__.py&quot;, line 363, in execute_from_command_line
      utility.execute()
    File &quot;/home/rails/Desktop/projects/envs/project_manage_env/local/lib/python2.7/site-packages/django/core/management/__init__.py&quot;, line 355, in execute
      self.fetch_command(subcommand).run_from_argv(self.argv)
    File &quot;/home/rails/Desktop/projects/envs/project_manage_env/local/lib/python2.7/site-packages/django/core/management/commands/test.py&quot;, line 29, in run_from_argv
      super(Command, self).run_from_argv(argv)
    File &quot;/home/rails/Desktop/projects/envs/project_manage_env/local/lib/python2.7/site-packages/django/core/management/base.py&quot;, line 283, in run_from_argv
      self.execute(*args, **cmd_options)
    File &quot;/home/rails/Desktop/projects/envs/project_manage_env/local/lib/python2.7/site-packages/django/core/management/base.py&quot;, line 330, in execute
      output = self.handle(*args, **options)
    File &quot;/home/rails/Desktop/projects/envs/project_manage_env/local/lib/python2.7/site-packages/django/core/management/commands/test.py&quot;, line 62, in handle
      failures = test_runner.run_tests(test_labels)
    File &quot;/home/rails/Desktop/projects/envs/project_manage_env/local/lib/python2.7/site-packages/django/test/runner.py&quot;, line 601, in run_tests
      old_config = self.setup_databases()
    File &quot;/home/rails/Desktop/projects/envs/project_manage_env/local/lib/python2.7/site-packages/django/test/runner.py&quot;, line 546, in setup_databases
      self.parallel, **kwargs
    File &quot;/home/rails/Desktop/projects/envs/project_manage_env/local/lib/python2.7/site-packages/django/test/utils.py&quot;, line 187, in setup_databases
      serialize=connection.settings_dict.get('TEST', {}).get('SERIALIZE', True),
    File &quot;/home/rails/Desktop/projects/envs/project_manage_env/local/lib/python2.7/site-packages/django/db/backends/base/creation.py&quot;, line 77, in create_test_db
      self.connection._test_serialized_contents = self.serialize_db_to_string()
    File &quot;/home/rails/Desktop/projects/envs/project_manage_env/local/lib/python2.7/site-packages/django/db/backends/base/creation.py&quot;, line 121, in serialize_db_to_string
      serializers.serialize(&quot;json&quot;, get_objects(), indent=None, stream=out)
    File &quot;/home/rails/Desktop/projects/envs/project_manage_env/local/lib/python2.7/site-packages/django/core/serializers/__init__.py&quot;, line 129, in serialize
      s.serialize(queryset, **options)
    File &quot;/home/rails/Desktop/projects/envs/project_manage_env/local/lib/python2.7/site-packages/django/core/serializers/base.py&quot;, line 80, in serialize
      for count, obj in enumerate(queryset, start=1):
    File &quot;/home/rails/Desktop/projects/envs/project_manage_env/local/lib/python2.7/site-packages/django/db/backends/base/creation.py&quot;, line 117, in get_objects
      for obj in queryset.iterator():
    File &quot;/home/rails/Desktop/projects/envs/project_manage_env/local/lib/python2.7/site-packages/django/db/models/query.py&quot;, line 53, in __iter__
      results = compiler.execute_sql(chunked_fetch=self.chunked_fetch)
    File &quot;/home/rails/Desktop/projects/envs/project_manage_env/local/lib/python2.7/site-packages/django/db/models/sql/compiler.py&quot;, line 880, in execute_sql
      cursor.close()
  psycopg2.OperationalError: cursor &quot;_django_curs_140351416325888_23&quot; does not exist
  </code></pre>