Exemplo n.º 1
0
 def test_update_timestamp_without_last_updated(self):
     result = timezone.datetime(2009, 1, 1).replace(tzinfo=timezone.utc)
     with mock.patch.object(timezone, 'datetime',
                            mock.Mock(wraps=timezone.datetime)) as mock_:
         mock_.now.return_value = result
         TimeStampPlugin.get_last_updated('TestPluginUpdate')
         TimeStampPlugin.update_timestamp('TestPluginUpdate')
         timestamp = TimeStampPlugin.get_last_updated('TestPluginUpdate')
     self.assertEquals(result, timestamp)
Exemplo n.º 2
0
 def test_update_timestamp_without_last_updated(self):
     result = timezone.datetime(2009, 1, 1).replace(tzinfo=timezone.utc)
     with mock.patch.object(timezone, 'datetime',
                            mock.Mock(wraps=timezone.datetime)) as mock_:
         mock_.now.return_value = result
         TimeStampPlugin.get_last_updated('TestPluginUpdate')
         TimeStampPlugin.update_timestamp('TestPluginUpdate')
         timestamp = TimeStampPlugin.get_last_updated('TestPluginUpdate')
     self.assertEquals(result, timestamp)
Exemplo n.º 3
0
 def save_last_update(self, last_updated, class_name):
     TimeStampPlugin.update_timestamp(class_name, last_updated=last_updated)
Exemplo n.º 4
0
 def create_sample_timestamp(self, class_name, date):
     TimeStampPlugin.get_last_updated(class_name)
     TimeStampPlugin.update_timestamp(class_name, last_updated=date)
Exemplo n.º 5
0
 def save_last_update(self, last_updated, class_name):
     TimeStampPlugin.update_timestamp(class_name, last_updated=last_updated)
Exemplo n.º 6
0
 def create_sample_timestamp(self, class_name, date):
     TimeStampPlugin.get_last_updated(class_name)
     TimeStampPlugin.update_timestamp(class_name, last_updated=date)