示例#1
0
文件: base.py 项目: sjl421/python-s42
 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)
示例#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)
示例#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))