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)
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))
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)
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))
def post_save(self, obj, created=True): send_bulk_sms.delay(obj)