se adiciona mas pruebas
FossilOrigin-Name: 68e716388ee3328b1b451997eca99dc1f20b47db4ebe3dfc761daec6fec3c8d6
This commit is contained in:
parent
d78a429711
commit
49feee8809
@ -194,6 +194,23 @@ def test_field_function_with_attribute():
|
||||
person = Person()
|
||||
assert '<Person hash="calculate"/>'
|
||||
|
||||
def test_field_function_with_model():
|
||||
class Hash(facho.model.Model):
|
||||
__name__ = 'Hash'
|
||||
|
||||
id = fields.Attribute('id')
|
||||
|
||||
class Person(facho.model.Model):
|
||||
__name__ = 'Person'
|
||||
|
||||
hash = fields.Function('get_hash', field=fields.Model(Hash))
|
||||
|
||||
def get_hash(self, name, field):
|
||||
field.id = 'calculate'
|
||||
|
||||
person = Person()
|
||||
assert '<Person><Hash id="calculate"/></Person>'
|
||||
|
||||
def test_field_function():
|
||||
class Person(facho.model.Model):
|
||||
__name__ = 'Person'
|
||||
|
Loading…
Reference in New Issue
Block a user