Code

Opened 4 years ago

Closed 4 years ago

Last modified 3 years ago

#12764 closed (fixed)

views tests fail with psycopg1 backend

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

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'...

Attachments (0)

Change History (5)

comment:1 Changed 4 years ago by Alex

  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset
  • Triage Stage changed from Unreviewed to Accepted

comment:2 follow-up: Changed 4 years ago by kmtracey

  • Resolution set to fixed
  • Status changed from new to closed

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

comment:3 Changed 4 years ago by kmtracey

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

r12832 from trunk.

comment:4 in reply to: ↑ 2 Changed 4 years ago by rbanffy

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 Changed 3 years ago by jacob

  • milestone 1.2 deleted

Milestone 1.2 deleted

Add Comment

Modify Ticket

Change Properties
<Author field>
Action
as closed
as The resolution will be set. Next status will be 'closed'
The resolution will be deleted. Next status will be 'new'
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.