Example #1
0
 def create_alternative(self, to_consume=True, directive=None):
     channel_view_model = ExampleChannel().create_alternative(to_consume)
     
     message = Message()
     message.message_id = 'b779df7b-d6f6-4afb-8165-8dbe6232119b'
     if not to_consume:
         message.message_uri = '/notification/v1/message/b779df7b-d6f6-4afb-8165-8dbe6232119b'
     message.message_type = 'uw_student_courseavailable1'
     message.direction = 'outbound'
     message.destination_type = 'channel'
     message.destination_id = 'b779df7b-d6f6-4afb-8165-8dbe6232119f'
     message.source_id = 'ASD234232DS2'
     message.subject = 'A DIFFERENT SUBJECT'
     message.body = 'Section is CLOSED for: FLUENCY IN INFORMATION TECHNOLOGY'
     message.short = 'Section is CLOSED for: 2012,autumn,cse,100,w'
     message.created = parser.parse('2012-11-13T21:49:07.162630+00:00').astimezone(tz.tzutc())
     message.last_modified = parser.parse('2012-11-13T21:49:07.162630+00:00').astimezone(tz.tzutc())
     
     if not to_consume:
         message.recipients = 1
         receipt_view_models = list()
         receipt_view_models.append(ExampleReceipt().create(to_consume=to_consume))
         message.receipts = ReceiptList()
         message.receipts.view_models = receipt_view_models  
         message.created = '2012-11-13 21:49:07.162630+00:00'
         message.last_modified = '2012-11-13 21:49:07.162630+00:00'
     else:
         message.receipts = None
             
     return message 
Example #2
0
    def create_alternative(self, to_consume=True, directive=None):
        channel_view_model = ExampleChannel().create_alternative(to_consume)

        message = Message()
        message.message_id = 'b779df7b-d6f6-4afb-8165-8dbe6232119b'
        if not to_consume:
            message.message_uri = '/notification/v1/message/b779df7b-d6f6-4afb-8165-8dbe6232119b'
        message.message_type = 'uw_student_courseavailable1'
        message.direction = 'outbound'
        message.destination_type = 'channel'
        message.destination_id = 'b779df7b-d6f6-4afb-8165-8dbe6232119f'
        message.source_id = 'ASD234232DS2'
        message.subject = 'A DIFFERENT SUBJECT'
        message.body = 'Section is CLOSED for: FLUENCY IN INFORMATION TECHNOLOGY'
        message.short = 'Section is CLOSED for: 2012,autumn,cse,100,w'
        message.created = parser.parse(
            '2012-11-13T21:49:07.162630+00:00').astimezone(tz.tzutc())
        message.last_modified = parser.parse(
            '2012-11-13T21:49:07.162630+00:00').astimezone(tz.tzutc())

        if not to_consume:
            message.recipients = 1
            receipt_view_models = list()
            receipt_view_models.append(
                ExampleReceipt().create(to_consume=to_consume))
            message.receipts = ReceiptList()
            message.receipts.view_models = receipt_view_models
            message.created = '2012-11-13 21:49:07.162630+00:00'
            message.last_modified = '2012-11-13 21:49:07.162630+00:00'
        else:
            message.receipts = None

        return message
Example #3
0
    def create(self, to_consume=True, sent=True, child=False):
        channel_view_model = ExampleChannel().create(to_consume=to_consume)
        
        message = Message()
        message.message_id = 'aa53f5b8-f7f9-4eae-9d8b-b92717d4b670'
        if not to_consume:
            message.message_uri = '/notification/v1/message/aa53f5b8-f7f9-4eae-9d8b-b92717d4b670'

        message.message_type = 'uw_student_courseavailable1'
        message.direction = 'outbound'
        message.destination_type = 'channel'
        message.destination_id = 'b779df7b-d6f6-4afb-8165-8dbe6232119f'
        message.source_id = 'ASD234232DS1'
        message.subject = 'FLUENCY IN INFORMATION TECHNOLOGY'
        message.body = 'Section is OPEN for: FLUENCY IN INFORMATION TECHNOLOGY'
        message.short = 'Section is OPEN for: 2012,autumn,cse,100,w'
        message.created = parser.parse('2012-11-13T21:49:07.162630+00:00').astimezone(tz.tzutc())
        message.last_modified = parser.parse('2012-11-13T21:49:07.162630+00:00').astimezone(tz.tzutc())
        
        if not to_consume:
            if not child:
                receipt_view_models = list()
                receipt_view_models.append(ExampleReceipt().create(to_consume=to_consume, sent=sent, child=True))
                message.receipts = ReceiptList()
                message.receipts.view_models = receipt_view_models  
            message.created = '2012-11-13 21:49:07.162630+00:00'
            message.last_modified = '2012-11-13 21:49:07.162630+00:00'
        else:
            message.receipts = None
                
        return message 
Example #4
0
    def create(self, to_consume=True, sent=True, child=False):
        channel_view_model = ExampleChannel().create(to_consume=to_consume)

        message = Message()
        message.message_id = 'aa53f5b8-f7f9-4eae-9d8b-b92717d4b670'
        if not to_consume:
            message.message_uri = '/notification/v1/message/aa53f5b8-f7f9-4eae-9d8b-b92717d4b670'

        message.message_type = 'uw_student_courseavailable1'
        message.direction = 'outbound'
        message.destination_type = 'channel'
        message.destination_id = 'b779df7b-d6f6-4afb-8165-8dbe6232119f'
        message.source_id = 'ASD234232DS1'
        message.subject = 'FLUENCY IN INFORMATION TECHNOLOGY'
        message.body = 'Section is OPEN for: FLUENCY IN INFORMATION TECHNOLOGY'
        message.short = 'Section is OPEN for: 2012,autumn,cse,100,w'
        message.created = parser.parse(
            '2012-11-13T21:49:07.162630+00:00').astimezone(tz.tzutc())
        message.last_modified = parser.parse(
            '2012-11-13T21:49:07.162630+00:00').astimezone(tz.tzutc())

        if not to_consume:
            if not child:
                receipt_view_models = list()
                receipt_view_models.append(ExampleReceipt().create(
                    to_consume=to_consume, sent=sent, child=True))
                message.receipts = ReceiptList()
                message.receipts.view_models = receipt_view_models
            message.created = '2012-11-13 21:49:07.162630+00:00'
            message.last_modified = '2012-11-13 21:49:07.162630+00:00'
        else:
            message.receipts = None

        return message