def test_update_old_msgs(self): address = u'*****@*****.**' archive_msg(self.store, 'sample8', address) get_digests( self.store, address)[0].scheduled_at = datetime.now() - timedelta(days=100) self.store._db.session.flush() self._test_update_no_msgs()
def _test_update(self, fileList, *addresses): for f in fileList: archive_msg(self.store, f, *addresses) self.assertTrue(self.distributor.update()) for user in addresses: self.assertEqual(self.store.messages_for_user(user), []) self.assertEqual(self.sender.send.call_count, len(addresses))
def test_update_done_msgs(self): address = u'*****@*****.**' archive_msg(self.store, 'sample9', address) self.store.mark_digest_as_sent(address) self._test_update_no_msgs()