def test_sensor_reading_job_notifications_after_four_hours( self, sensormodule, sqlalchemy): tests.fixtures.mock_sensors = [mocks.MockDigitalAbnormalSensor] sensor_persistence = NotificationPersistenceService() sensormodule.sensor_reading_job() notification = sensor_persistence.get_newest_notification( 'digital abnormal') notification.timestamp = datetime(1970, 1, 1) sensor_persistence.update(notification) sensormodule.sensor_reading_job() assert len(sensor_persistence.all()) == 2