﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
21226	"Simple index view test fails with error ""'NoneType' object has no attribute 'converter'"""	heraldhoi@…	nobody	"Test of index view with no polls mentioned in this [https://docs.djangoproject.com/en/1.5/intro/tutorial05/ tutorial] fails with `AttributeError: 'NoneType' object has no attribute 'converter'`

Complete traceback:


{{{
python manage.py test polls
Creating test database for alias 'default'...
.....E....
======================================================================
ERROR: test_index_view_with_no_polls (polls.tests.PollViewTests)
----------------------------------------------------------------------
Traceback (most recent call last):
  File ""/Users/arthurfayzrakhmanov/Documents/Labour/Python/radio_py/polls/tests.py"", line 54, in test_index_view_with_no_polls
    response = self.client.get( reverse( 'polls:index' ) )
  File ""/Users/arthurfayzrakhmanov/Documents/Labour/Python/ENV/lib/python2.7/site-packages/django/test/client.py"", line 453, in get
    response = super(Client, self).get(path, data=data, **extra)
  File ""/Users/arthurfayzrakhmanov/Documents/Labour/Python/ENV/lib/python2.7/site-packages/django/test/client.py"", line 279, in get
    return self.request(**r)
  File ""/Users/arthurfayzrakhmanov/Documents/Labour/Python/ENV/lib/python2.7/site-packages/django/test/client.py"", line 424, in request
    six.reraise(*exc_info)
  File ""/Users/arthurfayzrakhmanov/Documents/Labour/Python/ENV/lib/python2.7/site-packages/django/core/handlers/base.py"", line 140, in get_response
    response = response.render()
  File ""/Users/arthurfayzrakhmanov/Documents/Labour/Python/ENV/lib/python2.7/site-packages/django/template/response.py"", line 105, in render
    self.content = self.rendered_content
  File ""/Users/arthurfayzrakhmanov/Documents/Labour/Python/ENV/lib/python2.7/site-packages/django/template/response.py"", line 82, in rendered_content
    content = template.render(context)
  File ""/Users/arthurfayzrakhmanov/Documents/Labour/Python/ENV/lib/python2.7/site-packages/django/template/base.py"", line 140, in render
    return self._render(context)
  File ""/Users/arthurfayzrakhmanov/Documents/Labour/Python/ENV/lib/python2.7/site-packages/django/test/utils.py"", line 66, in instrumented_test_render
    return self.nodelist.render(context)
  File ""/Users/arthurfayzrakhmanov/Documents/Labour/Python/ENV/lib/python2.7/site-packages/django/template/base.py"", line 830, in render
    bit = self.render_node(node, context)
  File ""/Users/arthurfayzrakhmanov/Documents/Labour/Python/ENV/lib/python2.7/site-packages/django/template/debug.py"", line 74, in render_node
    return node.render(context)
  File ""/Users/arthurfayzrakhmanov/Documents/Labour/Python/ENV/lib/python2.7/site-packages/django/template/defaulttags.py"", line 284, in render
    if match:
  File ""/Users/arthurfayzrakhmanov/Documents/Labour/Python/ENV/lib/python2.7/site-packages/django/db/models/query.py"", line 157, in __nonzero__
    return type(self).__bool__(self)
  File ""/Users/arthurfayzrakhmanov/Documents/Labour/Python/ENV/lib/python2.7/site-packages/django/db/models/query.py"", line 151, in __bool__
    next(iter(self))
  File ""/Users/arthurfayzrakhmanov/Documents/Labour/Python/ENV/lib/python2.7/site-packages/django/db/models/query.py"", line 139, in _result_iter
    self._fill_cache()
  File ""/Users/arthurfayzrakhmanov/Documents/Labour/Python/ENV/lib/python2.7/site-packages/django/db/models/query.py"", line 941, in _fill_cache
    self._result_cache.append(next(self._iter))
  File ""/Users/arthurfayzrakhmanov/Documents/Labour/Python/ENV/lib/python2.7/site-packages/django/db/models/query.py"", line 317, in iterator
    for row in compiler.results_iter():
  File ""/Users/arthurfayzrakhmanov/Documents/Labour/Python/ENV/lib/python2.7/site-packages/django/db/models/sql/compiler.py"", line 775, in results_iter
    for rows in self.execute_sql(MULTI):
  File ""/Users/arthurfayzrakhmanov/Documents/Labour/Python/ENV/lib/python2.7/site-packages/django/db/models/sql/compiler.py"", line 830, in execute_sql
    sql, params = self.as_sql()
  File ""/Users/arthurfayzrakhmanov/Documents/Labour/Python/ENV/lib/python2.7/site-packages/django/db/models/sql/compiler.py"", line 85, in as_sql
    where, w_params = self.query.where.as_sql(qn=qn, connection=self.connection)
  File ""/Users/arthurfayzrakhmanov/Documents/Labour/Python/ENV/lib/python2.7/site-packages/django/db/models/sql/where.py"", line 97, in as_sql
    sql, params = child.as_sql(qn=qn, connection=connection)
  File ""/Users/arthurfayzrakhmanov/Documents/Labour/Python/ENV/lib/python2.7/site-packages/django/db/models/sql/where.py"", line 100, in as_sql
    sql, params = self.make_atom(child, qn, connection)
  File ""/Users/arthurfayzrakhmanov/Documents/Labour/Python/ENV/lib/python2.7/site-packages/django/db/models/sql/where.py"", line 161, in make_atom
    lvalue, params = lvalue.process(lookup_type, params_or_value, connection)
  File ""/Users/arthurfayzrakhmanov/Documents/Labour/Python/ENV/lib/python2.7/site-packages/django/db/models/sql/where.py"", line 352, in process
    connection=connection, prepared=True)
  File ""/Users/arthurfayzrakhmanov/Documents/Labour/Python/ENV/lib/python2.7/site-packages/django/db/models/fields/__init__.py"", line 359, in get_db_prep_lookup
    prepared=prepared)]
  File ""/Users/arthurfayzrakhmanov/Documents/Labour/Python/ENV/lib/python2.7/site-packages/django/db/models/fields/__init__.py"", line 836, in get_db_prep_value
    return connection.ops.value_to_db_datetime(value)
  File ""/Users/arthurfayzrakhmanov/Documents/Labour/Python/ENV/lib/python2.7/site-packages/mysql/connector/django/base.py"", line 343, in value_to_db_datetime
    return self.connection.connection.converter._datetime_to_mysql(value)
AttributeError: 'NoneType' object has no attribute 'converter'
}}}

`Python` **`2.7`**
`Django` **`1.5.4`**
`MySQL` **`5.6.13-enterprise-commercial-advanced MySQL Enterprise Server - Advanced Edition (Commercial)`**
`DB Connector` **`mysql_connector_python-1.1.1a1 ('mysql.connector.django')`**

This error only happen if there is no object creation in `test_index_view_with_no_polls`, if I add something like
{{{
create_poll( question = ""Past poll."", days = -30 )
}}}
test fails with `AssertionError: Couldn't find 'No polls are available.' in response` (as expected)

I don't know is this related to connector itself, it's alfa-vesion."	Bug	closed	Testing framework	1.5	Normal	invalid	mysql automated-tests connector index-view		Unreviewed	0	0	0	0	0	0
