擅长:python、mysql、java
<p>您安装的django autofixture版本不支持django1.9,因为它的<code>GenericRelation</code>的导入已过期。在</p>
<p>请尝试升级到最新版本。该项目的<a href="https://github.com/gregmuellegger/django-autofixture/blob/d38ae8feaf159178ebea65fbc343970e6f440258/CHANGES.rst" rel="nofollow">changelist</a>表示django1.9支持是在版本0.11.0中添加的。在</p>
<p>为了让Django在您的<code>AnimalTestCase</code>中运行您的方法,您需要重命名它,使其以<code>test_</code>开头:</p>
<pre><code>class AnimalTestCase(TestCase):
def test_say_hello(self):
print('Hello, World!')
</code></pre>