小编Mar*_*den的帖子

Django测试失败

我在运行django单元测试时遇到错误,我之前没有经历过这种情况,并且整个下午都在谷歌上搜索它.

我在运行django manage.py test后在终端中收到此错误:

Error: Database test_unconvention couldn't be flushed. Possible reasons:
  * The database isn't running or isn't configured correctly.
  * At least one of the expected database tables doesn't exist.
  * The SQL was invalid.
Hint: Look at the output of 'django-admin.py sqlflush'. That's the SQL this command wasn't able to run.
The full error: (1146, "Table 'test_unconvention.media_image' doesn't exist")
Run Code Online (Sandbox Code Playgroud)

运行django-admin.py sqlflush时会引用media_images表,并在运行django manage.py syncdb时生成ok.

这是图像模型,看起来很麻烦:

from django.db import models
from django.contrib.contenttypes.models import ContentType
from django.contrib.contenttypes import generic

class …
Run Code Online (Sandbox Code Playgroud)

python mysql django unit-testing mysql-error-1146

6
推荐指数
1
解决办法
1622
查看次数

无法运行ruby脚本/控制台

我在尝试ruby脚本/控制台时遇到此错误

Rails需要RubyGems> =.请安装RubyGems并重试

我正在运行ruby 1.8.6和rails 2.3.2并且我安装了RubyGems,所以这可能是$ PATH问题?

ruby macos terminal console rubygems

2
推荐指数
1
解决办法
1263
查看次数