django 从哪里获得 manage.py 测试的初始固定装置?
Where does django get initial fixtures from on manage.py test?
我正在尝试 运行 ./manage.py test
没有 固定装置。我已经删除了我从项目中找到的所有固定装置并制作了 ./manage.py flush
。当我 ./manage.py syncdb
时,我可以看到 Installed 0 object(s) from 0 fixture(s)
。
但是当我 运行 单个测试文件 ./manage.py test hello.tests.tests_selenium_login
直接不涉及固定装置时,它会以某种方式找到固定装置并打印 Installed 84 object(s) from 2 fixture(s)
这些固定装置应该在哪里?
upd
通过重新克隆回购解决。但我认为这是一种矫枉过正。并且不回答问题。
Django 默认在每个应用程序的 fixtures 文件夹中查找 fixtures
,以及您在 FIXTURE_DIRS 设置中指定的位置。
你的情况是第二个命令中没有initial_data
fixture, which is the one that gets loaded when you run syncdb/migrate. The fixture to load must be specified in the fixtures attribute of the testcase你运行。
我正在尝试 运行 ./manage.py test
没有 固定装置。我已经删除了我从项目中找到的所有固定装置并制作了 ./manage.py flush
。当我 ./manage.py syncdb
时,我可以看到 Installed 0 object(s) from 0 fixture(s)
。
但是当我 运行 单个测试文件 ./manage.py test hello.tests.tests_selenium_login
直接不涉及固定装置时,它会以某种方式找到固定装置并打印 Installed 84 object(s) from 2 fixture(s)
这些固定装置应该在哪里?
upd
通过重新克隆回购解决。但我认为这是一种矫枉过正。并且不回答问题。
Django 默认在每个应用程序的 fixtures 文件夹中查找 fixtures
,以及您在 FIXTURE_DIRS 设置中指定的位置。
你的情况是第二个命令中没有initial_data
fixture, which is the one that gets loaded when you run syncdb/migrate. The fixture to load must be specified in the fixtures attribute of the testcase你运行。