Example #1
0
 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 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)
Example #3
0
 def post(self):
     self.repository.save(entity(self.param('field1'), self.param('field2')))
     self.render('entity/index.html', data=self.repository.list())
Example #4
0
 def setup(self):
     self.session = mock()
     self.repository = entity_repository(self.session)
     self.msg = entity("Field1 data", "Field1 data")