def render(self, dto, abstract=False): """Render an :class:`~s42.datastructures.AddressDTO` into a :class:`~s42.template.RenderedAddress` instance. """ if isinstance(dto, dict): dto = AddressDTO.fromdict(dto) return AddressRendition(self, dto, abstract=abstract)
def test_is_populated(self): for fixture in self.fixtures: dto = AddressDTO.fromdict(fixture['data']) for code in fixture.get('is_populated', []): self.assertTrue(dto.is_populated(code))