WilliamRen / django-pyodbc

Automatically exported from code.google.com/p/django-pyodbc
BSD 3-Clause "New" or "Revised" License
0 stars 0 forks source link

AttributeError: 'list' object has no attribute 'split' exception at field, order = o.split(".")[-1].split(' ') in multiple tests when running Django test suite #39

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?

Run the Django test suite (as of rev. 9788) against an SQL Server 2000
database using django-pyodbc trunk as of r134

What is the expected output? What do you see instead?

Expected: Most test pass
Actual result: The following tests fail because of this bug:

ERROR: Test add view restricts access and actually adds items.
----------------------------------------------------------------------
Traceback (most recent call last):
  File "~/django/tests/regressiontests/admin_views/tests.py", line 360, in
testAddView

ERROR: Delete view should restrict access and actually delete items.
----------------------------------------------------------------------
Traceback (most recent call last):
  File "~/django/tests/regressiontests/admin_views/tests.py", line 484, in
testDeleteView

ERROR: testLogin (regressiontests.admin_views.tests.AdminViewPermissionsTest)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "~/django/tests/regressiontests/admin_views/tests.py", line 273, in
testLogin

ERROR: testLoginSuccessfullyRedirectsToOriginalUrl
(regressiontests.admin_views.tests.AdminViewPermissionsTest)
----------------------------------------------------------------------
Traceback (most recent call last):

ERROR: The link from the recent actions list referring to the changeform of
the object should be quoted
----------------------------------------------------------------------
Traceback (most recent call last):
  File "~/django/tests/regressiontests/admin_views/tests.py", line 517, in
test_recentactions_link

ERROR: testCustomAdminSiteIndexViewAndTemplate
(regressiontests.admin_views.tests.CustomModelAdminTest)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "~/django/tests/regressiontests/admin_views/tests.py", line 186, in
testCustomAdminSiteIndexViewAndTemplate

ERROR: Moderation queue should display non-public, non-removed comments.
----------------------------------------------------------------------
Traceback (most recent call last):
  File
"~/django/tests/regressiontests/comment_tests/tests/moderation_view_tests.py",
line 183, in testModerationQueueContents

File "~/django/django/contrib/sessions/tests.py", line 53, in
django.contrib.sessions.tests
Failed example:
    Session.objects.filter(pk=db_session.session_key).delete()

File "~/django/django/contrib/sessions/tests.py", line 128, in
django.contrib.sessions.tests
Failed example:
    Session.objects.filter(pk=file_session.session_key).delete()

File "~/django/django/contrib/sessions/tests.py", line 186, in
django.contrib.sessions.tests
Failed example:
    Session.objects.filter(pk=cache_session.session_key).delete()

File "~/django/tests/modeltests/basic/models.py", line ?, in
modeltests.basic.models.__test__.API_TESTS
Failed example:
    Article.objects.filter(id__lte=4).delete()

File "~/django/tests/modeltests/many_to_one/models.py", line ?, in
modeltests.many_to_one.models.__test__.API_TESTS
Failed example:
    Reporter.objects.filter(article__headline__startswith='This').delete()

File "~/django/tests/modeltests/model_formsets/models.py", line ?, in
modeltests.model_formsets.models.__test__.API_TESTS
Failed example:
    formset = AuthorFormSet(queryset=qs)

File "~/django/tests/modeltests/model_formsets/models.py", line ?, in
modeltests.model_formsets.models.__test__.API_TESTS
Failed example:
    formset = AuthorFormSet(queryset=qs)

File "~/django/tests/modeltests/model_formsets/models.py", line ?, in
modeltests.model_formsets.models.__test__.API_TESTS
Failed example:
    formset = FormSet(instance=owner)

File "~/django/tests/modeltests/model_formsets/models.py", line ?, in
modeltests.model_formsets.models.__test__.API_TESTS
Failed example:
    formset = FormSet(data, instance=owner)

File "~/django/tests/modeltests/model_formsets/models.py", line ?, in
modeltests.model_formsets.models.__test__.API_TESTS
Failed example:
    formset = FormSet(instance=owner)

File "~/django/tests/modeltests/model_formsets/models.py", line ?, in
modeltests.model_formsets.models.__test__.API_TESTS
Failed example:
    formset = FormSet(data, instance=owner)

File "~/django/tests/modeltests/model_formsets/models.py", line ?, in
modeltests.model_formsets.models.__test__.API_TESTS
Failed example:
    formset = FormSet(instance=place)

File "~/django/tests/modeltests/order_with_respect_to/models.py", line ?,
in modeltests.order_with_respect_to.models.__test__.API_TESTS
Failed example:
    a4.get_previous_in_order()

File "~/django/tests/modeltests/get_latest/models.py", line ?, in
modeltests.get_latest.models.__test__.API_TESTS
Failed example:
    Article.objects.latest()

File "~/django/tests/modeltests/get_latest/models.py", line ?, in
modeltests.get_latest.models.__test__.API_TESTS
Failed example:
    Article.objects.filter(pub_date__lt=datetime(2005, 7, 27)).latest()

File "~/django/tests/modeltests/get_latest/models.py", line ?, in
modeltests.get_latest.models.__test__.API_TESTS
Failed example:
    Article.objects.latest('expire_date')

File "~/django/tests/modeltests/get_latest/models.py", line ?, in
modeltests.get_latest.models.__test__.API_TESTS
Failed example:
    Article.objects.filter(pub_date__gt=datetime(2005, 7,
26)).latest('expire_date')

File "~/django/tests/modeltests/get_latest/models.py", line ?, in
modeltests.get_latest.models.__test__.API_TESTS
Failed example:
    Person.objects.latest('birthday')

File "~/django/tests/modeltests/select_related/models.py", line ?, in
modeltests.select_related.models.__test__.API_TESTS
Failed example:

Species.objects.all().select_related('genus__family__order').order_by('id')[0:1]
.get().genus.family.order.name

File "~/django/tests/modeltests/generic_relations/models.py", line ?, in
modeltests.generic_relations.models.__test__.API_TESTS
Failed example:
    TaggedItem.objects.filter(tag='fatty').delete()

Example of a traceback:

Exception raised:
    Traceback (most recent call last):
      File "~/django/django/test/_doctest.py", line 1267, in __run
        compileflags, 1) in test.globs
      File "<doctest
regressiontests.model_inheritance_regress.models.__test__.API_TESTS[43]>",
line 1, in <module>
        Restaurant.objects.all().delete()
      File "~/django/django/db/models/query.py", line 427, in delete
        for object in del_query[:CHUNK_SIZE]:
      File "~/django/django/db/models/query.py", line 186, in _result_iter
        self._fill_cache()
      File "~/django/django/db/models/query.py", line 667, in _fill_cache
        self._result_cache.append(self._iter.next())
      File "~/django/django/db/models/query.py", line 281, in iterator
        for row in self.query.results_iter():
      File "~/django/django/db/models/sql/query.py", line 240, in results_iter
        for rows in self.execute_sql(MULTI):
      File "~/django/django/db/models/sql/query.py", line 1950, in execute_sql
        sql, params = self.as_sql()
      File
"/home/ramiro/src/django-pyodbc/trunk/sql_server/pyodbc/query.py", line
197, in as_sql
        field, order = o.split(".")[-1].split(' ')
    AttributeError: 'list' object has no attribute 'split'

Original issue reported on code.google.com by cra...@gmail.com on 24 Jan 2009 at 3:08

GoogleCodeExporter commented 8 years ago
Fixed in r135.

Original comment by cra...@gmail.com on 24 Jan 2009 at 5:06