示例#1
0
 def post_save(self, obj, created=True):
     locations = self.get_location(obj)
     phone_numbers = list(UserProfile.objects(location__in=locations).values_list('phone'))
     if obj.ptype == 'yesno':
         text = '%s Reply With: NECOCPoll YES/NO' % obj.question
     else:
         text = '%s Reply With: NECOCPoll %s ...' % (obj.question, obj.keyword)
     send_bulk_sms.delay(obj, phone_numbers, text)
示例#2
0
    def test_send_new_user_email_sends_email(self, mock_send_mail):
        subject = 'subject'
        message = 'message'
        from_email = 'from_email'
        recipient_list = ['recipient_list']

        send_bulk_sms.delay(subject, message, from_email, recipient_list, fail_silently=False)

        self.assertTrue(mock_send_mail.called_once_with(subject, message, from_email, recipient_list, fail_silently=False))
示例#3
0
 def post_save(self, obj, created=True):
     locations = self.get_location(obj)
     phone_numbers = list(
         UserProfile.objects(location__in=locations).values_list('phone'))
     if obj.ptype == 'yesno':
         text = '%s Reply With: NECOCPoll YES/NO' % obj.question
     else:
         text = '%s Reply With: NECOCPoll %s ...' % (obj.question,
                                                     obj.keyword)
     send_bulk_sms.delay(obj, phone_numbers, text)
示例#4
0
    def test_send_new_user_email_sends_email(self, mock_send_mail):
        subject = 'subject'
        message = 'message'
        from_email = 'from_email'
        recipient_list = ['recipient_list']

        send_bulk_sms.delay(subject,
                            message,
                            from_email,
                            recipient_list,
                            fail_silently=False)

        self.assertTrue(
            mock_send_mail.called_once_with(subject,
                                            message,
                                            from_email,
                                            recipient_list,
                                            fail_silently=False))
示例#5
0
 def post_save(self, obj, created=True):
     send_bulk_sms.delay(obj)
示例#6
0
 def post_save(self, obj, created=True):
     send_bulk_sms.delay(obj)