[Django] #16246: Small problems with new generic IP address field tests on Postgres 8.4

18 views
Skip to first unread message

Django

unread,
Jun 13, 2011, 9:58:25 AM6/13/11
to django-...@googlegroups.com
#16246: Small problems with new generic IP address field tests on Postgres 8.4
------------------------+---------------------------------------------
Reporter: ramiro | Owner: nobody
Type: Bug | Status: new
Milestone: | Component: Testing framework
Version: SVN | Severity: Normal
Keywords: | Triage Stage: Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
------------------------+---------------------------------------------
Tes suite doesn't start to run because it can't create some permission
table:
{{{
Traceback (most recent call last):
File "./runtests.py", line 330, in <module>
failures = django_tests(int(options.verbosity), options.interactive,
options.failfast, args)
File "./runtests.py", line 197, in django_tests
failures = test_runner.run_tests(test_labels, extra_tests=extra_tests)
File "django/test/simple.py", line 354, in run_tests
old_config = self.setup_databases()
File "django/test/simple.py", line 291, in setup_databases
test_db_name = connection.creation.create_test_db(self.verbosity,
autoclobber=not self.interactive)
File "django/db/backends/creation.py", line 239, in create_test_db
load_initial_data=False)
File "django/core/management/__init__.py", line 166, in call_command
return klass.execute(*args, **defaults)
File "django/core/management/base.py", line 220, in execute
output = self.handle(*args, **options)
File "django/core/management/base.py", line 351, in handle
return self.handle_noargs(**options)
File "django/core/management/commands/syncdb.py", line 109, in
handle_noargs
emit_post_sync_signal(created_models, verbosity, interactive, db)
File "django/core/management/sql.py", line 190, in emit_post_sync_signal
interactive=interactive, db=db)
File "django/dispatch/dispatcher.py", line 172, in send
response = receiver(signal=self, sender=sender, **named)
File "django/contrib/auth/management/__init__.py", line 56, in
create_permissions
content_type=ctype
File "django/db/models/manager.py", line 138, in create
return self.get_query_set().create(**kwargs)
File "django/db/models/query.py", line 360, in create
obj.save(force_insert=True, using=self.db)
File "django/db/models/base.py", line 463, in save
self.save_base(using=using, force_insert=force_insert,
force_update=force_update)
File "django/db/models/base.py", line 556, in save_base
result = manager._insert(values, return_id=update_pk, using=using)
File "django/db/models/manager.py", line 198, in _insert
return insert_query(self.model, values, **kwargs)
File "django/db/models/query.py", line 1456, in insert_query
return query.get_compiler(using=using).execute_sql(return_id)
File "django/db/models/sql/compiler.py", line 810, in execute_sql
cursor = super(SQLInsertCompiler, self).execute_sql(None)
File "django/db/models/sql/compiler.py", line 754, in execute_sql
cursor.execute(sql, params)
File "django/db/backends/postgresql_psycopg2/base.py", line 44, in
execute
return self.cursor.execute(query, args)
django.db.utils.DatabaseError: value too long for type character
varying(50)
}}}

It's the row corresponding to this test model:

https://code.djangoproject.com/browser/django/trunk/tests/modeltests/validation/models.py?rev=16366#L91

Strange thing is why people using PosgreSQL 9 doesn't see this?

Once that is fixed, then there are six errors:

{{{
}}}

They are about the `GenericIPAddressField`'s in that model and the one
before it, because they are marked `blank=True` and not `null=True`. From
whai I understand: Being Postgres the only backend that doesn't represent
the new generic IP address model field with a char DDL field but with a
dedicated native data type it doesn't know how to interpret `''` when it
is given with such value to store, at least in 8.4.

--
Ticket URL: <https://code.djangoproject.com/ticket/16246>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

Django

unread,
Jun 13, 2011, 1:34:00 PM6/13/11
to django-...@googlegroups.com
#16246: Small problems with new generic IP address field tests on Postgres 8.4
--------------------------------------+-----------------------------------
Reporter: ramiro | Owner: nobody
Type: Bug | Status: new
Milestone: | Component: Testing framework
Version: SVN | Severity: Normal
Resolution: | Keywords:
Triage Stage: Unreviewed | Has patch: 0
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 0
UI/UX: 0 |
--------------------------------------+-----------------------------------
Description changed by ramiro:

Old description:
New description:
Once that is fixed, then there is one error:
{{{
======================================================================
ERROR: test_v4_unpack_uniqueness_detection
(modeltests.validation.tests.GenericIPAddressFieldTests)
----------------------------------------------------------------------
Traceback (most recent call last):
File "tests/modeltests/validation/tests.py", line 175, in
test_v4_unpack_uniqueness_detection
giptm.save()
File "django/db/models/base.py", line 463, in save
self.save_base(using=using, force_insert=force_insert,
force_update=force_update)
File "django/db/models/base.py", line 556, in save_base
result = manager._insert(values, return_id=update_pk, using=using)
File "django/db/models/manager.py", line 198, in _insert
return insert_query(self.model, values, **kwargs)
File "django/db/models/query.py", line 1456, in insert_query
return query.get_compiler(using=using).execute_sql(return_id)
File "django/db/models/sql/compiler.py", line 810, in execute_sql
cursor = super(SQLInsertCompiler, self).execute_sql(None)
File "django/db/models/sql/compiler.py", line 754, in execute_sql
cursor.execute(sql, params)
File "django/db/backends/postgresql_psycopg2/base.py", line 44, in
execute
return self.cursor.execute(query, args)
DatabaseError: invalid input syntax for type inet: ""
LINE 1: ..., "v4_ip", "v6_ip") VALUES (E'::ffff:10.10.10.10', E'', E'')
^
}}}

(That causes five errors later in `modeltests.serializers`,
`modeltests.proxy_model_inheritance`, `modeltests.fixtures` and
`regressiontests.bug639`)

It's about the `GenericIPAddressField`'s in that model and the one before
it, because they are marked `blank=True` and not `null=True`. From whai I
understand: Being Postgres the only backend that doesn't represent the new
generic IP address model field with a char DDL field but with a dedicated
native data type it doesn't know how to interpret `''` when it is given
with such value to store, at least in 8.4.

--

--
Ticket URL: <https://code.djangoproject.com/ticket/16246#comment:1>

Django

unread,
Jun 13, 2011, 1:38:17 PM6/13/11
to django-...@googlegroups.com
#16246: Small problems with new generic IP address field tests on Postgres 8.4
--------------------------------------+-----------------------------------
Reporter: ramiro | Owner: nobody
Type: Bug | Status: new
Milestone: | Component: Testing framework
Version: SVN | Severity: Normal
Resolution: | Keywords:
Triage Stage: Unreviewed | Has patch: 0
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 0
UI/UX: 0 |
--------------------------------------+-----------------------------------

Comment (by ramiro):

In [16392]:
{{{
#!CommitTicketReference repository="" revision="16392"
Removed a name clash in a test method. Refs #16246.
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/16246#comment:2>

Django

unread,
Jun 13, 2011, 3:51:36 PM6/13/11
to django-...@googlegroups.com
#16246: Small problems with new generic IP address field tests on Postgres 8.4
------------------------------------+-----------------------------------
Reporter: ramiro | Owner: nobody
Type: Bug | Status: new
Milestone: | Component: Testing framework
Version: SVN | Severity: Normal
Resolution: | Keywords:
Triage Stage: Accepted | Has patch: 0
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 0
UI/UX: 0 |
------------------------------------+-----------------------------------
Changes (by aaugustin):

* stage: Unreviewed => Accepted


--
Ticket URL: <https://code.djangoproject.com/ticket/16246#comment:3>

Django

unread,
Jun 13, 2011, 4:15:14 PM6/13/11
to django-...@googlegroups.com
#16246: Small problems with new generic IP address field tests on Postgres 8.4
------------------------------------+-----------------------------------
Reporter: ramiro | Owner: nobody
Type: Bug | Status: closed
Milestone: | Component: Testing framework
Version: SVN | Severity: Normal
Resolution: fixed | Keywords:
Triage Stage: Accepted | Has patch: 0
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 0
UI/UX: 0 |
------------------------------------+-----------------------------------
Changes (by jezdez):

* status: new => closed
* resolution: => fixed


Comment:

In [16395]:
{{{
#!CommitTicketReference repository="" revision="16395"
Fixed #16246 -- Fixed GenericIPAddressField tests on PostgreSQL.
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/16246#comment:4>

Django

unread,
Feb 2, 2014, 8:04:29 PM2/2/14
to django-...@googlegroups.com
#16246: Small problems with new generic IP address field tests on Postgres 8.4
-----------------------------------+--------------------------------------
Reporter: ramiro | Owner: nobody
Type: Bug | Status: closed
Component: Testing framework | Version: 1.5-beta-1

Severity: Normal | Resolution: fixed
Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-----------------------------------+--------------------------------------
Changes (by HYTRbpycuXKuHvrEY):

* version: master => 1.5-beta-1


Comment:

<a href=http://reglenna.com/doc/#kgx>read more</a> ativan every 8 hours -
lorazepam 1mg elderly

--
Ticket URL: <https://code.djangoproject.com/ticket/16246#comment:5>

Django

unread,
Feb 3, 2014, 6:43:16 AM2/3/14
to django-...@googlegroups.com
#16246: Small problems with new generic IP address field tests on Postgres 8.4
-----------------------------------+------------------------------------
Reporter: ramiro | Owner: nobody
Type: Bug | Status: closed
Component: Testing framework | Version: 1.4-rc-1

Severity: Normal | Resolution: fixed
Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-----------------------------------+------------------------------------
Changes (by eATBZLYSmjnuQBbqS):

* version: master => 1.4-rc-1


Comment:

<a href=http://reglenna.com/doc/#yw12>morea€¦</a> ativan withdrawal
insomnia - ativan addiction substance abuse

Reply all
Reply to author
Forward
0 new messages