South安装后Django测试出现问题

发布于 2024-11-26 03:45:22 字数 10466 浏览 3 评论 0原文

安装 South 后,我的测试中开始出现一些错误。我尝试过 SKIP_SOUTH_TESTS=True 和 SOUTH_TESTS_MIGRATE = False,但没有运气。这是输出:

Creating test database for alias 'default'...
....................................................................................................................................................................................................................................................................................................................s...........................................................................EEEE.............
======================================================================
ERROR: testCharFieldCreate (django_extensions.tests.encrypted_fields.EncryptedFieldsTestCase)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/rodrigo/Workspace/.virtualenvs/nossodesconto_django_fork/lib/python2.6/site-packages/django_extensions/tests/encrypted_fields.py", line 31, in setUp
    call_command('syncdb', verbosity=0)
  File "/home/rodrigo/Workspace/.virtualenvs/nossodesconto_django_fork/lib/python2.6/site-packages/django/core/management/__init__.py", line 166, in call_command
    return klass.execute(*args, **defaults)
  File "/home/rodrigo/Workspace/.virtualenvs/nossodesconto_django_fork/lib/python2.6/site-packages/django/core/management/base.py", line 220, in execute
    output = self.handle(*args, **options)
  File "/home/rodrigo/Workspace/.virtualenvs/nossodesconto_django_fork/lib/python2.6/site-packages/django/core/management/base.py", line 351, in handle
    return self.handle_noargs(**options)
  File "/home/rodrigo/Workspace/.virtualenvs/nossodesconto_django_fork/lib/python2.6/site-packages/django/core/management/commands/syncdb.py", line 109, in handle_noargs
    emit_post_sync_signal(created_models, verbosity, interactive, db)
  File "/home/rodrigo/Workspace/.virtualenvs/nossodesconto_django_fork/lib/python2.6/site-packages/django/core/management/sql.py", line 190, in emit_post_sync_signal
    interactive=interactive, db=db)
  File "/home/rodrigo/Workspace/.virtualenvs/nossodesconto_django_fork/lib/python2.6/site-packages/django/dispatch/dispatcher.py", line 172, in send
    response = receiver(signal=self, sender=sender, **named)
  File "/home/rodrigo/Workspace/.virtualenvs/nossodesconto_django_fork/lib/python2.6/site-packages/django/contrib/auth/management/__init__.py", line 30, in create_permissions
    ctype = ContentType.objects.get_for_model(klass)
  File "/home/rodrigo/Workspace/.virtualenvs/nossodesconto_django_fork/lib/python2.6/site-packages/django/contrib/contenttypes/models.py", line 40, in get_for_model
    self._add_to_cache(self.db, ct)
  File "/home/rodrigo/Workspace/.virtualenvs/nossodesconto_django_fork/lib/python2.6/site-packages/django/contrib/contenttypes/models.py", line 70, in _add_to_cache
    key = (model._meta.app_label, model._meta.object_name.lower())
AttributeError: 'NoneType' object has no attribute '_meta'

======================================================================
ERROR: testCharFieldRead (django_extensions.tests.encrypted_fields.EncryptedFieldsTestCase)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/rodrigo/Workspace/.virtualenvs/nossodesconto_django_fork/lib/python2.6/site-packages/django_extensions/tests/encrypted_fields.py", line 31, in setUp
    call_command('syncdb', verbosity=0)
  File "/home/rodrigo/Workspace/.virtualenvs/nossodesconto_django_fork/lib/python2.6/site-packages/django/core/management/__init__.py", line 166, in call_command
    return klass.execute(*args, **defaults)
  File "/home/rodrigo/Workspace/.virtualenvs/nossodesconto_django_fork/lib/python2.6/site-packages/django/core/management/base.py", line 220, in execute
    output = self.handle(*args, **options)
  File "/home/rodrigo/Workspace/.virtualenvs/nossodesconto_django_fork/lib/python2.6/site-packages/django/core/management/base.py", line 351, in handle
    return self.handle_noargs(**options)
  File "/home/rodrigo/Workspace/.virtualenvs/nossodesconto_django_fork/lib/python2.6/site-packages/django/core/management/commands/syncdb.py", line 109, in handle_noargs
    emit_post_sync_signal(created_models, verbosity, interactive, db)
  File "/home/rodrigo/Workspace/.virtualenvs/nossodesconto_django_fork/lib/python2.6/site-packages/django/core/management/sql.py", line 190, in emit_post_sync_signal
    interactive=interactive, db=db)
  File "/home/rodrigo/Workspace/.virtualenvs/nossodesconto_django_fork/lib/python2.6/site-packages/django/dispatch/dispatcher.py", line 172, in send
    response = receiver(signal=self, sender=sender, **named)
  File "/home/rodrigo/Workspace/.virtualenvs/nossodesconto_django_fork/lib/python2.6/site-packages/django/contrib/auth/management/__init__.py", line 30, in create_permissions
    ctype = ContentType.objects.get_for_model(klass)
  File "/home/rodrigo/Workspace/.virtualenvs/nossodesconto_django_fork/lib/python2.6/site-packages/django/contrib/contenttypes/models.py", line 40, in get_for_model
    self._add_to_cache(self.db, ct)
  File "/home/rodrigo/Workspace/.virtualenvs/nossodesconto_django_fork/lib/python2.6/site-packages/django/contrib/contenttypes/models.py", line 70, in _add_to_cache
    key = (model._meta.app_label, model._meta.object_name.lower())
AttributeError: 'NoneType' object has no attribute '_meta'

======================================================================
ERROR: testTextFieldCreate (django_extensions.tests.encrypted_fields.EncryptedFieldsTestCase)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/rodrigo/Workspace/.virtualenvs/nossodesconto_django_fork/lib/python2.6/site-packages/django_extensions/tests/encrypted_fields.py", line 31, in setUp
    call_command('syncdb', verbosity=0)
  File "/home/rodrigo/Workspace/.virtualenvs/nossodesconto_django_fork/lib/python2.6/site-packages/django/core/management/__init__.py", line 166, in call_command
    return klass.execute(*args, **defaults)
  File "/home/rodrigo/Workspace/.virtualenvs/nossodesconto_django_fork/lib/python2.6/site-packages/django/core/management/base.py", line 220, in execute
    output = self.handle(*args, **options)
  File "/home/rodrigo/Workspace/.virtualenvs/nossodesconto_django_fork/lib/python2.6/site-packages/django/core/management/base.py", line 351, in handle
    return self.handle_noargs(**options)
  File "/home/rodrigo/Workspace/.virtualenvs/nossodesconto_django_fork/lib/python2.6/site-packages/django/core/management/commands/syncdb.py", line 109, in handle_noargs
    emit_post_sync_signal(created_models, verbosity, interactive, db)
  File "/home/rodrigo/Workspace/.virtualenvs/nossodesconto_django_fork/lib/python2.6/site-packages/django/core/management/sql.py", line 190, in emit_post_sync_signal
    interactive=interactive, db=db)
  File "/home/rodrigo/Workspace/.virtualenvs/nossodesconto_django_fork/lib/python2.6/site-packages/django/dispatch/dispatcher.py", line 172, in send
    response = receiver(signal=self, sender=sender, **named)
  File "/home/rodrigo/Workspace/.virtualenvs/nossodesconto_django_fork/lib/python2.6/site-packages/django/contrib/auth/management/__init__.py", line 30, in create_permissions
    ctype = ContentType.objects.get_for_model(klass)
  File "/home/rodrigo/Workspace/.virtualenvs/nossodesconto_django_fork/lib/python2.6/site-packages/django/contrib/contenttypes/models.py", line 40, in get_for_model
    self._add_to_cache(self.db, ct)
  File "/home/rodrigo/Workspace/.virtualenvs/nossodesconto_django_fork/lib/python2.6/site-packages/django/contrib/contenttypes/models.py", line 70, in _add_to_cache
    key = (model._meta.app_label, model._meta.object_name.lower())
AttributeError: 'NoneType' object has no attribute '_meta'

======================================================================
ERROR: testTextFieldRead (django_extensions.tests.encrypted_fields.EncryptedFieldsTestCase)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/rodrigo/Workspace/.virtualenvs/nossodesconto_django_fork/lib/python2.6/site-packages/django_extensions/tests/encrypted_fields.py", line 31, in setUp
    call_command('syncdb', verbosity=0)
  File "/home/rodrigo/Workspace/.virtualenvs/nossodesconto_django_fork/lib/python2.6/site-packages/django/core/management/__init__.py", line 166, in call_command
    return klass.execute(*args, **defaults)
  File "/home/rodrigo/Workspace/.virtualenvs/nossodesconto_django_fork/lib/python2.6/site-packages/django/core/management/base.py", line 220, in execute
    output = self.handle(*args, **options)
  File "/home/rodrigo/Workspace/.virtualenvs/nossodesconto_django_fork/lib/python2.6/site-packages/django/core/management/base.py", line 351, in handle
    return self.handle_noargs(**options)
  File "/home/rodrigo/Workspace/.virtualenvs/nossodesconto_django_fork/lib/python2.6/site-packages/django/core/management/commands/syncdb.py", line 109, in handle_noargs
    emit_post_sync_signal(created_models, verbosity, interactive, db)
  File "/home/rodrigo/Workspace/.virtualenvs/nossodesconto_django_fork/lib/python2.6/site-packages/django/core/management/sql.py", line 190, in emit_post_sync_signal
    interactive=interactive, db=db)
  File "/home/rodrigo/Workspace/.virtualenvs/nossodesconto_django_fork/lib/python2.6/site-packages/django/dispatch/dispatcher.py", line 172, in send
    response = receiver(signal=self, sender=sender, **named)
  File "/home/rodrigo/Workspace/.virtualenvs/nossodesconto_django_fork/lib/python2.6/site-packages/django/contrib/auth/management/__init__.py", line 30, in create_permissions
    ctype = ContentType.objects.get_for_model(klass)
  File "/home/rodrigo/Workspace/.virtualenvs/nossodesconto_django_fork/lib/python2.6/site-packages/django/contrib/contenttypes/models.py", line 40, in get_for_model
    self._add_to_cache(self.db, ct)
  File "/home/rodrigo/Workspace/.virtualenvs/nossodesconto_django_fork/lib/python2.6/site-packages/django/contrib/contenttypes/models.py", line 70, in _add_to_cache
    key = (model._meta.app_label, model._meta.object_name.lower())
AttributeError: 'NoneType' object has no attribute '_meta'

----------------------------------------------------------------------
Ran 401 tests in 16.147s

有什么建议或想法吗?

非常感谢

After installing South, some errors started happening in my tests. I've tried SKIP_SOUTH_TESTS=True and SOUTH_TESTS_MIGRATE = False, but with no luck. Here is the output:

Creating test database for alias 'default'...
....................................................................................................................................................................................................................................................................................................................s...........................................................................EEEE.............
======================================================================
ERROR: testCharFieldCreate (django_extensions.tests.encrypted_fields.EncryptedFieldsTestCase)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/rodrigo/Workspace/.virtualenvs/nossodesconto_django_fork/lib/python2.6/site-packages/django_extensions/tests/encrypted_fields.py", line 31, in setUp
    call_command('syncdb', verbosity=0)
  File "/home/rodrigo/Workspace/.virtualenvs/nossodesconto_django_fork/lib/python2.6/site-packages/django/core/management/__init__.py", line 166, in call_command
    return klass.execute(*args, **defaults)
  File "/home/rodrigo/Workspace/.virtualenvs/nossodesconto_django_fork/lib/python2.6/site-packages/django/core/management/base.py", line 220, in execute
    output = self.handle(*args, **options)
  File "/home/rodrigo/Workspace/.virtualenvs/nossodesconto_django_fork/lib/python2.6/site-packages/django/core/management/base.py", line 351, in handle
    return self.handle_noargs(**options)
  File "/home/rodrigo/Workspace/.virtualenvs/nossodesconto_django_fork/lib/python2.6/site-packages/django/core/management/commands/syncdb.py", line 109, in handle_noargs
    emit_post_sync_signal(created_models, verbosity, interactive, db)
  File "/home/rodrigo/Workspace/.virtualenvs/nossodesconto_django_fork/lib/python2.6/site-packages/django/core/management/sql.py", line 190, in emit_post_sync_signal
    interactive=interactive, db=db)
  File "/home/rodrigo/Workspace/.virtualenvs/nossodesconto_django_fork/lib/python2.6/site-packages/django/dispatch/dispatcher.py", line 172, in send
    response = receiver(signal=self, sender=sender, **named)
  File "/home/rodrigo/Workspace/.virtualenvs/nossodesconto_django_fork/lib/python2.6/site-packages/django/contrib/auth/management/__init__.py", line 30, in create_permissions
    ctype = ContentType.objects.get_for_model(klass)
  File "/home/rodrigo/Workspace/.virtualenvs/nossodesconto_django_fork/lib/python2.6/site-packages/django/contrib/contenttypes/models.py", line 40, in get_for_model
    self._add_to_cache(self.db, ct)
  File "/home/rodrigo/Workspace/.virtualenvs/nossodesconto_django_fork/lib/python2.6/site-packages/django/contrib/contenttypes/models.py", line 70, in _add_to_cache
    key = (model._meta.app_label, model._meta.object_name.lower())
AttributeError: 'NoneType' object has no attribute '_meta'

======================================================================
ERROR: testCharFieldRead (django_extensions.tests.encrypted_fields.EncryptedFieldsTestCase)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/rodrigo/Workspace/.virtualenvs/nossodesconto_django_fork/lib/python2.6/site-packages/django_extensions/tests/encrypted_fields.py", line 31, in setUp
    call_command('syncdb', verbosity=0)
  File "/home/rodrigo/Workspace/.virtualenvs/nossodesconto_django_fork/lib/python2.6/site-packages/django/core/management/__init__.py", line 166, in call_command
    return klass.execute(*args, **defaults)
  File "/home/rodrigo/Workspace/.virtualenvs/nossodesconto_django_fork/lib/python2.6/site-packages/django/core/management/base.py", line 220, in execute
    output = self.handle(*args, **options)
  File "/home/rodrigo/Workspace/.virtualenvs/nossodesconto_django_fork/lib/python2.6/site-packages/django/core/management/base.py", line 351, in handle
    return self.handle_noargs(**options)
  File "/home/rodrigo/Workspace/.virtualenvs/nossodesconto_django_fork/lib/python2.6/site-packages/django/core/management/commands/syncdb.py", line 109, in handle_noargs
    emit_post_sync_signal(created_models, verbosity, interactive, db)
  File "/home/rodrigo/Workspace/.virtualenvs/nossodesconto_django_fork/lib/python2.6/site-packages/django/core/management/sql.py", line 190, in emit_post_sync_signal
    interactive=interactive, db=db)
  File "/home/rodrigo/Workspace/.virtualenvs/nossodesconto_django_fork/lib/python2.6/site-packages/django/dispatch/dispatcher.py", line 172, in send
    response = receiver(signal=self, sender=sender, **named)
  File "/home/rodrigo/Workspace/.virtualenvs/nossodesconto_django_fork/lib/python2.6/site-packages/django/contrib/auth/management/__init__.py", line 30, in create_permissions
    ctype = ContentType.objects.get_for_model(klass)
  File "/home/rodrigo/Workspace/.virtualenvs/nossodesconto_django_fork/lib/python2.6/site-packages/django/contrib/contenttypes/models.py", line 40, in get_for_model
    self._add_to_cache(self.db, ct)
  File "/home/rodrigo/Workspace/.virtualenvs/nossodesconto_django_fork/lib/python2.6/site-packages/django/contrib/contenttypes/models.py", line 70, in _add_to_cache
    key = (model._meta.app_label, model._meta.object_name.lower())
AttributeError: 'NoneType' object has no attribute '_meta'

======================================================================
ERROR: testTextFieldCreate (django_extensions.tests.encrypted_fields.EncryptedFieldsTestCase)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/rodrigo/Workspace/.virtualenvs/nossodesconto_django_fork/lib/python2.6/site-packages/django_extensions/tests/encrypted_fields.py", line 31, in setUp
    call_command('syncdb', verbosity=0)
  File "/home/rodrigo/Workspace/.virtualenvs/nossodesconto_django_fork/lib/python2.6/site-packages/django/core/management/__init__.py", line 166, in call_command
    return klass.execute(*args, **defaults)
  File "/home/rodrigo/Workspace/.virtualenvs/nossodesconto_django_fork/lib/python2.6/site-packages/django/core/management/base.py", line 220, in execute
    output = self.handle(*args, **options)
  File "/home/rodrigo/Workspace/.virtualenvs/nossodesconto_django_fork/lib/python2.6/site-packages/django/core/management/base.py", line 351, in handle
    return self.handle_noargs(**options)
  File "/home/rodrigo/Workspace/.virtualenvs/nossodesconto_django_fork/lib/python2.6/site-packages/django/core/management/commands/syncdb.py", line 109, in handle_noargs
    emit_post_sync_signal(created_models, verbosity, interactive, db)
  File "/home/rodrigo/Workspace/.virtualenvs/nossodesconto_django_fork/lib/python2.6/site-packages/django/core/management/sql.py", line 190, in emit_post_sync_signal
    interactive=interactive, db=db)
  File "/home/rodrigo/Workspace/.virtualenvs/nossodesconto_django_fork/lib/python2.6/site-packages/django/dispatch/dispatcher.py", line 172, in send
    response = receiver(signal=self, sender=sender, **named)
  File "/home/rodrigo/Workspace/.virtualenvs/nossodesconto_django_fork/lib/python2.6/site-packages/django/contrib/auth/management/__init__.py", line 30, in create_permissions
    ctype = ContentType.objects.get_for_model(klass)
  File "/home/rodrigo/Workspace/.virtualenvs/nossodesconto_django_fork/lib/python2.6/site-packages/django/contrib/contenttypes/models.py", line 40, in get_for_model
    self._add_to_cache(self.db, ct)
  File "/home/rodrigo/Workspace/.virtualenvs/nossodesconto_django_fork/lib/python2.6/site-packages/django/contrib/contenttypes/models.py", line 70, in _add_to_cache
    key = (model._meta.app_label, model._meta.object_name.lower())
AttributeError: 'NoneType' object has no attribute '_meta'

======================================================================
ERROR: testTextFieldRead (django_extensions.tests.encrypted_fields.EncryptedFieldsTestCase)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/rodrigo/Workspace/.virtualenvs/nossodesconto_django_fork/lib/python2.6/site-packages/django_extensions/tests/encrypted_fields.py", line 31, in setUp
    call_command('syncdb', verbosity=0)
  File "/home/rodrigo/Workspace/.virtualenvs/nossodesconto_django_fork/lib/python2.6/site-packages/django/core/management/__init__.py", line 166, in call_command
    return klass.execute(*args, **defaults)
  File "/home/rodrigo/Workspace/.virtualenvs/nossodesconto_django_fork/lib/python2.6/site-packages/django/core/management/base.py", line 220, in execute
    output = self.handle(*args, **options)
  File "/home/rodrigo/Workspace/.virtualenvs/nossodesconto_django_fork/lib/python2.6/site-packages/django/core/management/base.py", line 351, in handle
    return self.handle_noargs(**options)
  File "/home/rodrigo/Workspace/.virtualenvs/nossodesconto_django_fork/lib/python2.6/site-packages/django/core/management/commands/syncdb.py", line 109, in handle_noargs
    emit_post_sync_signal(created_models, verbosity, interactive, db)
  File "/home/rodrigo/Workspace/.virtualenvs/nossodesconto_django_fork/lib/python2.6/site-packages/django/core/management/sql.py", line 190, in emit_post_sync_signal
    interactive=interactive, db=db)
  File "/home/rodrigo/Workspace/.virtualenvs/nossodesconto_django_fork/lib/python2.6/site-packages/django/dispatch/dispatcher.py", line 172, in send
    response = receiver(signal=self, sender=sender, **named)
  File "/home/rodrigo/Workspace/.virtualenvs/nossodesconto_django_fork/lib/python2.6/site-packages/django/contrib/auth/management/__init__.py", line 30, in create_permissions
    ctype = ContentType.objects.get_for_model(klass)
  File "/home/rodrigo/Workspace/.virtualenvs/nossodesconto_django_fork/lib/python2.6/site-packages/django/contrib/contenttypes/models.py", line 40, in get_for_model
    self._add_to_cache(self.db, ct)
  File "/home/rodrigo/Workspace/.virtualenvs/nossodesconto_django_fork/lib/python2.6/site-packages/django/contrib/contenttypes/models.py", line 70, in _add_to_cache
    key = (model._meta.app_label, model._meta.object_name.lower())
AttributeError: 'NoneType' object has no attribute '_meta'

----------------------------------------------------------------------
Ran 401 tests in 16.147s

Any suggestions or ideas?

Many thanks

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

遗失的美好 2024-12-03 03:45:22

问题是已知的。一些特殊的数据字段不兼容 South,它包括来自 django 扩展的加密字段,这里是问题和补丁: https://github.com/django-extensions/django-extensions/pull/103

编辑:补丁已合并。它在 master 中,并将在下一个版本中出现。

The problem is known. Some special data fields are not South complient, it include the encrypted fields from django extension, here the issue and the patch: https://github.com/django-extensions/django-extensions/pull/103

edit: the patch has been merged. it's in master and will be in next release.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文