2015-02-18 93 views
1

我一直在Django項目的一些門票中工作。我目前正在爲1.7分支機構工作。當我嘗試執行整個測試套件我得到這個錯誤:運行Django測試套件的錯誤

$user ~/workspace/Code/django/tests $ PYTHONPATH=..:$PYTHONPATH ./runtests.py 
Testing against Django installed in '/home/user/workspace/Code/django/django' 
Creating test database for alias 'default'... 
Traceback (most recent call last): 
    File "./runtests.py", line 410, in <module> 
    options.failfast, args) 
    File "./runtests.py", line 252, in django_tests 
    test_labels or get_installed(), extra_tests=extra_tests) 
    File "/home/user/workspace/Code/django/django/test/runner.py", line 147, in run_tests 
    old_config = self.setup_databases() 
    File "/home/user/workspace/Code/django/django/test/runner.py", line 109, in setup_databases 
    return setup_databases(self.verbosity, self.interactive, **kwargs) 
    File "/home/user/workspace/Code/django/django/test/runner.py", line 299, in setup_databases 
    serialize=connection.settings_dict.get("TEST", {}).get("SERIALIZE", True), 
    File "/home/user/workspace/Code/django/django/db/backends/creation.py", line 385, in create_test_db 
    self.connection._test_serialized_contents = self.serialize_db_to_string() 
    File "/home/user/workspace/Code/django/django/db/backends/creation.py", line 421, in serialize_db_to_string 
    serializers.serialize("json", get_objects(), indent=None, stream=out) 
    File "/home/user/workspace/Code/django/django/core/serializers/__init__.py", line 128, in serialize 
    s.serialize(queryset, **options) 
    File "/home/user/workspace/Code/django/django/core/serializers/base.py", line 52, in serialize 
    for obj in queryset: 
    File "/home/user/workspace/Code/django/django/db/backends/creation.py", line 417, in get_objects 
    for obj in queryset.iterator(): 
    File "/home/user/workspace/Code/django/django/db/models/query.py", line 265, in iterator 
    for row in compiler.results_iter(): 
    File "/home/user/workspace/Code/django/django/db/models/sql/compiler.py", line 700, in results_iter 
    for rows in self.execute_sql(MULTI): 
    File "/home/user/workspace/Code/django/django/db/models/sql/compiler.py", line 786, in execute_sql 
    cursor.execute(sql, params) 
    File "/home/user/workspace/Code/django/django/db/backends/utils.py", line 65, in execute 
    return self.cursor.execute(sql, params) 
    File "/home/user/workspace/Code/django/django/db/utils.py", line 94, in __exit__ 
    six.reraise(dj_exc_type, dj_exc_value, traceback) 
    File "/home/user/workspace/Code/django/django/db/backends/utils.py", line 65, in execute 
    return self.cursor.execute(sql, params) 
    File "/home/user/workspace/Code/django/django/db/backends/sqlite3/base.py", line 485, in execute 
    return Database.Cursor.execute(self, query, params) 
django.db.utils.OperationalError: no such table: sites_framework_syndicatedarticle 

回答

0

我固定它這樣做的:git clean -fdx

我希望它可以幫助別人。

0

試試這個在您的設置文件

if 'test' in sys.argv: 
    DATABASES = { 
     'default':{ 
      'ENGINE': 'django.db.backends.sqlite3', 
      'NAME': ':memory:', 
      'TEST_NAME': ':memory:', 
     }, 
    } 
+0

不幸的是,它不工作。 – 2015-02-18 09:34:42