def test_list_of(self): f = Field(name="NAME") f.list_of() self.assertIsNone(f.inside_instanciator) self.assertEqual(f.instanciator, list) self.assertEqual(f.is_list, True) f.list_of(inside_instanciator=dict) self.assertEqual(f.inside_instanciator, dict)
def test_get_inside_instance(self): f = Field(name="NAME") f.list_of(inside_instanciator=dict) value = f.get_inside_instance({"data": "DATA"}, None) self.assertIsInstance(value, dict) self.assertEqual(value, {"data": "DATA"}) f.list_of() value = f.get_inside_instance("data", None) self.assertIsInstance(value, str) self.assertEqual(value, "data")