

def test_nullable_foreign_keys(self):
    x = models.SimplestModel()
    x.save()
    self.addCleanup(x.delete)
    nfk_alias = adapter.DjangoClassAlias(models.NullForeignKey, None)
    bfk_alias = adapter.DjangoClassAlias(models.BlankForeignKey, None)
    nfk = models.NullForeignKey()
    attrs = nfk_alias.getEncodableAttributes(nfk)
    self.assertEqual(attrs, {
        'id': None,
    })
    bfk = models.BlankForeignKey()
    attrs = bfk_alias.getEncodableAttributes(bfk)
    self.assertEqual(attrs, {
        'id': None,
    })

dataset/ETHPy150Open AppScale/appscale/AppServer/lib/PyAMF-0.6.1/pyamf/tests/adapters/test_django.py ForeignKeyTestCase.test_nullable_foreign_keys/original