Exemplo n.º 1
0
 def setUp(self):
     self.comment = Comment('*****@*****.**', 'Happy new year!',
                            datetime.datetime(2012, 1, 1))
     self.data = {
         'email': '*****@*****.**',
         'content': 'x' * 1001,
         'created': datetime.datetime(2012, 1, 1)
     }
     self.actionitem = ActionItem(title='Some to do item', )
Exemplo n.º 2
0
 def restore_object(self, data, instance=None):
     if instance is None:
         return ActionItem(**data)
     for key, val in data.items():
         setattr(instance, key, val)
     return instance