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