Esempio n. 1
0
 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)
Esempio n. 2
0
 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)
Esempio n. 3
0
 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))
 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))