它因许多与相关名称相关的问题而失败。当然,在运行实际的开发服务器(使用./manage.py runserver
)时不会发生这种情况,我猜模型可能会生成两次?我正在运行 psycopg2 2.4.1,这是我的测试输出:
(venv)lacrymology@Roller:boilerplate$ ./manage.py test
Creating test database for alias 'default'...
Error: One or more models did not validate:
l10n.address: Accessor for field 'user_shipping' clashes with related field 'User.shipping_address'. Add a related_name argument to the definition for 'user_shipping'.
l10n.address: Reverse query name for field 'user_shipping' clashes with related field 'User.shipping_address'. Add a related_name argument to the definition for 'user_shipping'.
l10n.address: Accessor for field 'user_billing' clashes with related field 'User.billing_address'. Add a related_name argument to the definition for 'user_billing'.
l10n.address: Reverse query name for field 'user_billing' clashes with related field 'User.billing_address'. Add a related_name argument to the definition for 'user_billing'.
custom_registration.profile: Accessor for field 'user' clashes with related field 'User.profile'. Add a related_name argument to the definition for 'user'.
custom_registration.profile: Reverse query name for field 'user' clashes with related field 'User.profile'. Add a related_name argument to the definition for 'user'.
addressmodel.address: Accessor for field 'user_shipping' clashes with related field 'User.shipping_address'. Add a related_name argument to the definition for 'user_shipping'.
addressmodel.address: Reverse query name for field 'user_shipping' clashes with related field 'User.shipping_address'. Add a related_name argument to the definition for 'user_shipping'.
addressmodel.address: Accessor for field 'user_billing' clashes with related field 'User.billing_address'. Add a related_name argument to the definition for 'user_billing'.
addressmodel.address: Reverse query name for field 'user_billing' clashes with related field 'User.billing_address'. Add a related_name argument to the definition for 'user_billing'.
profiles.profile: Accessor for field 'user' clashes with related field 'User.profile'. Add a related_name argument to the definition for 'user'.
profiles.profile: Reverse query name for field 'user' clashes with related field 'User.profile'. Add a related_name argument to the definition for 'user'.