예제 #1
0
    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()
예제 #2
0
    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))
예제 #3
0
    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()