Opened 15 years ago

Closed 15 years ago

Last modified 13 years ago

#12764 closed (fixed)

views tests fail with psycopg1 backend

Reported by: Karen Tracey Owned by: nobody
Component: Database layer (models, ORM) Version: dev
Severity: Keywords:
Cc: Triage Stage: Accepted
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

2 of 39 tests fail, reason looks to be the same for both:

.........E...E.........................
======================================================================
ERROR: test_bad_content_type (regressiontests.views.tests.defaults.DefaultsTests)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "D:\u\kmt\django\trunk\tests\regressiontests\views\tests\defaults.py", line 47, in test_bad_content_type
    response = self.client.get(short_url)
  File "d:\u\kmt\django\trunk\django\test\client.py", line 286, in get
    response = self.request(**r)
  File "d:\u\kmt\django\trunk\django\core\handlers\base.py", line 101, in get_response
    response = callback(request, *callback_args, **callback_kwargs)
  File "d:\u\kmt\django\trunk\django\views\defaults.py", line 35, in shortcut
    return real_shortcut(request, content_type_id, object_id)
  File "d:\u\kmt\django\trunk\django\contrib\contenttypes\views.py", line 10, in shortcut
    content_type = ContentType.objects.get(pk=content_type_id)
  File "d:\u\kmt\django\trunk\django\db\models\manager.py", line 132, in get
    return self.get_query_set().get(*args, **kwargs)
  File "d:\u\kmt\django\trunk\django\db\models\query.py", line 334, in get
    num = len(clone)
  File "d:\u\kmt\django\trunk\django\db\models\query.py", line 79, in __len__
    self._result_cache = list(self.iterator())
  File "d:\u\kmt\django\trunk\django\db\models\query.py", line 267, in iterator
    for row in compiler.results_iter():
  File "d:\u\kmt\django\trunk\django\db\models\sql\compiler.py", line 685, in results_iter
    for rows in self.execute_sql(MULTI):
  File "d:\u\kmt\django\trunk\django\db\models\sql\compiler.py", line 740, in execute_sql
    cursor.execute(sql, params)
  File "d:\u\kmt\django\trunk\django\db\backends\postgresql\base.py", line 57, in execute
    return self.cursor.execute(smart_str(sql, self.charset), self.format_params(params))
DatabaseError: ERROR:  value "4242424242" is out of range for type integer

SELECT "django_content_type"."id", "django_content_type"."name", "django_content_type"."app_label", "django_content_type
"."model" FROM "dja

======================================================================
ERROR: test_shortcut_bad_pk (regressiontests.views.tests.defaults.DefaultsTests)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "D:\u\kmt\django\trunk\tests\regressiontests\views\tests\defaults.py", line 35, in test_shortcut_bad_pk
    response = self.client.get(short_url)
  File "d:\u\kmt\django\trunk\django\test\client.py", line 286, in get
    response = self.request(**r)
  File "d:\u\kmt\django\trunk\django\core\handlers\base.py", line 101, in get_response
    response = callback(request, *callback_args, **callback_kwargs)
  File "d:\u\kmt\django\trunk\django\views\defaults.py", line 35, in shortcut
    return real_shortcut(request, content_type_id, object_id)
  File "d:\u\kmt\django\trunk\django\contrib\contenttypes\views.py", line 11, in shortcut
    obj = content_type.get_object_for_this_type(pk=object_id)
  File "d:\u\kmt\django\trunk\django\contrib\contenttypes\models.py", line 102, in get_object_for_this_type
    return self.model_class()._default_manager.using(self._state.db).get(**kwargs)
  File "d:\u\kmt\django\trunk\django\db\models\query.py", line 334, in get
    num = len(clone)
  File "d:\u\kmt\django\trunk\django\db\models\query.py", line 79, in __len__
    self._result_cache = list(self.iterator())
  File "d:\u\kmt\django\trunk\django\db\models\query.py", line 267, in iterator
    for row in compiler.results_iter():
  File "d:\u\kmt\django\trunk\django\db\models\sql\compiler.py", line 685, in results_iter
    for rows in self.execute_sql(MULTI):
  File "d:\u\kmt\django\trunk\django\db\models\sql\compiler.py", line 740, in execute_sql
    cursor.execute(sql, params)
  File "d:\u\kmt\django\trunk\django\db\backends\postgresql\base.py", line 57, in execute
    return self.cursor.execute(smart_str(sql, self.charset), self.format_params(params))
DatabaseError: ERROR:  value "4242424242" is out of range for type integer

SELECT "views_author"."id", "views_author"."name" FROM "views_author" WHERE "views_author"."id" = '4242424242'

----------------------------------------------------------------------
Ran 39 tests in 20.800s

FAILED (errors=2)
Destroying test database 'default'...
Destroying test database 'other'...

Change History (5)

comment:1 by Alex Gaynor, 15 years ago

Triage Stage: UnreviewedAccepted

comment:2 by Karen Tracey, 15 years ago

Resolution: fixed
Status: newclosed

(In [12832]) Fixed #12764: Avoid exceeding psycopg1 limits in the views tests.

comment:3 by Karen Tracey, 15 years ago

(In [12833]) [1.1.X] Fixed #12764: Avoid exceeding psycopg1 limits in the views tests.

r12832 from trunk.

in reply to:  2 comment:4 by rbanffy, 14 years ago

Replying to kmtracey:

(In [12832]) Fixed #12764: Avoid exceeding psycopg1 limits in the views tests.

In the future, we could write a test that makes sure psycopg1 fails here, for the unlikely event it fails silently in the future.

comment:5 by Jacob, 13 years ago

milestone: 1.2

Milestone 1.2 deleted

Note: See TracTickets for help on using tickets.
Back to Top