change length CharField in tests #13

merged 1 commit into from Oct 10, 2012


None yet
2 participants

beniwohli commented Oct 10, 2012

The tests use values longer than 3, resulting in test failures.

At least PostgreSQL complains loudly when a value doesn't fit into the varchar:

ERROR: test_unknow_transition_fails (django_fsm.tests.BlogPostWithFKStateTest)
Traceback (most recent call last):
  File "/home/benjamin/projects/django-fsm/django_fsm/", line 145, in setUp
  File "/home/benjamin/.dotfiles/buildout/eggs/Django-1.4.1-py2.7.egg/django/db/models/", line 137, in create
    return self.get_query_set().create(**kwargs)
  File "/home/benjamin/.dotfiles/buildout/eggs/Django-1.4.1-py2.7.egg/django/db/models/", line 377, in create, using=self.db)
  File "/home/benjamin/.dotfiles/buildout/eggs/Django-1.4.1-py2.7.egg/django/db/models/", line 463, in save
    self.save_base(using=using, force_insert=force_insert, force_update=force_update)
  File "/home/benjamin/.dotfiles/buildout/eggs/Django-1.4.1-py2.7.egg/django/db/models/", line 551, in save_base
    result = manager._insert([self], fields=fields, return_id=update_pk, using=using, raw=raw)
  File "/home/benjamin/.dotfiles/buildout/eggs/Django-1.4.1-py2.7.egg/django/db/models/", line 203, in _insert
    return insert_query(self.model, objs, fields, **kwargs)
  File "/home/benjamin/.dotfiles/buildout/eggs/Django-1.4.1-py2.7.egg/django/db/models/", line 1576, in insert_query
    return query.get_compiler(using=using).execute_sql(return_id)
  File "/home/benjamin/.dotfiles/buildout/eggs/Django-1.4.1-py2.7.egg/django/db/models/sql/", line 910, in execute_sql
    cursor.execute(sql, params)
  File "/home/benjamin/.dotfiles/buildout/eggs/Django-1.4.1-py2.7.egg/django/db/backends/postgresql_psycopg2/", line 52, in execute
    return self.cursor.execute(query, args)
DatabaseError: value too long for type character varying(3)
change length CharField to accommodate all the po…
…ssible states in the tests

At least PostgreSQL complains loudly when a value doesn't fit into the varchar.

kmmbvnr added a commit that referenced this pull request Oct 10, 2012

Merge pull request #13 from piquadrat/feature/test-fix
change length CharField in tests

@kmmbvnr kmmbvnr merged commit 0137b70 into kmmbvnr:master Oct 10, 2012

This comment has been minimized.

Show comment Hide comment

kmmbvnr Oct 10, 2012




kmmbvnr commented Oct 10, 2012


Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment