

def test_file(self):
    alias = adapter.DjangoClassAlias(models.FileModel)
    i = models.FileModel()
    i.file.save('bar', MockFile())
    self.addCleanup(i.file.delete)
    i.save()
    attrs = alias.getEncodableAttributes(i)
    self.assertEqual(attrs, {
        'text': '',
        'id': 1,
        'file': 'file_model/bar',
    })
    attrs = alias.getDecodableAttributes(i, attrs)
    self.assertEqual(attrs, {
        'text': '',
    })

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