Example #1
0
    def test_notification_list(self):
        trs = create_transmittal()
        rev = trs.latest_revision

        trs.recipient.users.add(UserFactory(email='*****@*****.**'))
        trs.recipient.users.add(UserFactory(email='*****@*****.**'))
        trs.recipient.users.add(UserFactory(email='*****@*****.**'))

        send_transmittal_creation_notifications(trs, rev)
        self.assertEqual(len(mail.outbox), 3)
Example #2
0
    def test_notification_list(self):
        trs = create_transmittal()
        rev = trs.latest_revision

        trs.recipient.users.add(UserFactory(email='*****@*****.**'))
        trs.recipient.users.add(UserFactory(email='*****@*****.**'))
        trs.recipient.users.add(UserFactory(email='*****@*****.**'))

        send_transmittal_creation_notifications(trs, rev)
        self.assertEqual(len(mail.outbox), 3)
Example #3
0
def do_notify_transmittal_recipients(metadata_id, revision_id):
    """Send email notifs to transmittal recipients."""
    logger.info('Notifying transmittal recipients. Meta={} Rev={}'.format(
        metadata_id, revision_id))

    transmittal = OutgoingTransmittal.objects \
        .select_related('document', 'recipient') \
        .prefetch_related('recipient__users') \
        .get(pk=metadata_id)
    revision = OutgoingTransmittalRevision.objects.get(pk=revision_id)
    send_transmittal_creation_notifications(transmittal, revision)
Example #4
0
def do_notify_transmittal_recipients(metadata_id, revision_id):
    """Send email notifs to transmittal recipients."""
    logger.info('Notifying transmittal recipients. Meta={} Rev={}'.format(
        metadata_id, revision_id
    ))

    transmittal = OutgoingTransmittal.objects \
        .select_related('document', 'recipient') \
        .prefetch_related('recipient__users') \
        .get(pk=metadata_id)
    revision = OutgoingTransmittalRevision.objects.get(pk=revision_id)
    send_transmittal_creation_notifications(transmittal, revision)
Example #5
0
    def test_empty_notification_list(self):
        trs = create_transmittal()
        rev = trs.latest_revision
        send_transmittal_creation_notifications(trs, rev)

        self.assertEqual(len(mail.outbox), 0)
Example #6
0
    def test_empty_notification_list(self):
        trs = create_transmittal()
        rev = trs.latest_revision
        send_transmittal_creation_notifications(trs, rev)

        self.assertEqual(len(mail.outbox), 0)