

def test_referenced_encode(self):
    f = models.ParentReference()
    f.name = 'foo'
    b = models.ChildReference()
    b.name = 'bar'
    f.save()
    b.foo = f
    b.save()
    f.bar = b
    f.save()
    self.addCleanup(f.delete)
    self.addCleanup(b.delete)
    self.assertEqual(f.id, 1)
    foo = models.ParentReference.objects.select_related().get(id=1)
    foo.bar.foo
    self.assertEncoded(foo, '\n\x0b\x01\x07bar\n\x0b\x01\x07foo\n\x00\x05id\x04\x01\tname\x06\x00\x01\x04\x04\x01\x06\x06\x02\x01')

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