def test_get_value_from_instance(self): instance = NonCallableMock( foo=NonCallableMock(bar=["alpha", "beta", "gamma"]) ) field = ListField(TextField(attr='foo.bar')) self.assertEqual( field.get_value_from_instance(instance), instance.foo.bar)
def test_get_mapping(self): field = ListField(IntegerField(attr='foo.bar')) self.assertEqual({ 'type': 'integer', }, field.to_dict())
def test_get_mapping(self): field = ListField(StringField(attr='foo.bar')) self.assertEqual({ 'type': 'string', }, field.to_dict())