

def test_undefined(self):
    from django.db import models
    from django.db.models import fields

    class UndefinedClass(models.Model):
        pass
    alias = adapter.DjangoClassAlias(UndefinedClass, None)
    x = UndefinedClass()
    alias.applyAttributes(x, {
        'id': pyamf.Undefined,
    })
    self.assertEqual(x.id, fields.NOT_PROVIDED)
    x.id = fields.NOT_PROVIDED
    attrs = alias.getEncodableAttributes(x)
    self.assertEqual(attrs, {
        'id': pyamf.Undefined,
    })

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