def setup(self): self.handler = object.__new__(entity_handler) self.repository = mock() self.handler.initialize(self.repository) self.entity = entity("Field1 data", "Field2 data") when(self.repository).load(1).thenReturn(self.entity) when(self.handler).render().thenReturn(None)
def post(self): self.repository.save(entity(self.param('field1'), self.param('field2'))) self.render('entity/index.html', data=self.repository.list())
def setup(self): self.session = mock() self.repository = entity_repository(self.session) self.msg = entity("Field1 data", "Field1 data")