Example #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)
Example #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)
 def save_last_update(self, last_updated, class_name):
     TimeStampPlugin.update_timestamp(class_name, last_updated=last_updated)
Example #4
0
 def create_sample_timestamp(self, class_name, date):
     TimeStampPlugin.get_last_updated(class_name)
     TimeStampPlugin.update_timestamp(class_name, last_updated=date)
Example #5
0
 def save_last_update(self, last_updated, class_name):
     TimeStampPlugin.update_timestamp(class_name, last_updated=last_updated)
Example #6
0
 def create_sample_timestamp(self, class_name, date):
     TimeStampPlugin.get_last_updated(class_name)
     TimeStampPlugin.update_timestamp(class_name, last_updated=date)