On MySQL this does not fail when using InnoDB. It should fail, as both reporter and associated bug with ID=1 are missing.

The reason for this is that in django/db/backends/creation.py, sql_for_pending_references() is a check: if not model._meta.managed or model._meta.proxy: skip creation
Now, that is incorrect: the model in question is the model we are _referring_, not the model from where the PK is from. So, under MySQL foreign keys to proxy models do not get enforced in the DB.

In addition the same bug is there for other databases, too. However, this one does not show under PostgreSQL as the foreign key is created inline. However, were the order of the models different in models.py also PostgreSQL would fail to create the foreign key.

The fix is luckily very simple: just remove the "or proxy" part. The managed part is correct: the referenced model can be a view for example, in which case referencing it would be a failure.

I think a more appropriate regression test could live in test_operations and issue an AddField of a foreign key pointing to ProxyPony and make sure the constraint exists. Naturally the test should be skipUnlessDBFeature('supports_foreign_keys').