fix writing into foreign key with non-null source
fix ticket link in test docstring
Merge pull request #1170 from craigds/write-into-foreignkey-with-source

fix writing into foreign key with non-null source