2011-07-26 83 views
1

安裝南安裝後,一些錯誤開始發生在我的測試中。我試過SKIP_SOUTH_TESTS = True和SOUTH_TESTS_MIGRATE = False,但沒有運氣。這裏是輸出:南安裝後Django的測試問題

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 

任何意見或建議?

非常感謝

+0

由於您使用的是virtualenv,您確實在virtualenv中安裝了南,而您在virtualenv中運行過測試嗎? – cwoebker

回答