Esempio n. 1
0
 def run(self, **kwargs):
     logger = self.get_logger(**kwargs)
     logger.info("TASK :: sms_campaign_expire_check")
     from sms_module.views import common_sms_campaign_status
     for sms_campaign in SMSCampaign.objects.get_expired_sms_campaign():
         logger.debug("=> SMS Campaign name %s (id:%s)" % (sms_campaign.name,
                                                           sms_campaign.id))
         common_sms_campaign_status(sms_campaign.id, SMS_CAMPAIGN_STATUS.END)
Esempio n. 2
0
    def test_campaign_form(self):
        self.assertEqual(self.smscampaign.name, "SMS Campaign")
        SMSCampaign.objects.get_running_sms_campaign()
        SMSCampaign.objects.get_expired_sms_campaign()

        self.smscampaign.status = SMS_CAMPAIGN_STATUS.PAUSE
        self.smscampaign.save()
        self.smscampaign.update_sms_campaign_status()
        get_url_sms_campaign_status(self.smscampaign.pk, self.smscampaign.status)

        self.smscampaign.status = SMS_CAMPAIGN_STATUS.ABORT
        self.smscampaign.save()
        self.smscampaign.update_sms_campaign_status()
        get_url_sms_campaign_status(self.smscampaign.pk, self.smscampaign.status)

        self.smscampaign.status = SMS_CAMPAIGN_STATUS.END
        self.smscampaign.save()
        self.smscampaign.update_sms_campaign_status()
        get_url_sms_campaign_status(self.smscampaign.pk, self.smscampaign.status)

        self.smscampaign.is_authorized_contact('123456789')

        self.smscampaign.get_active_max_frequency()
        self.smscampaign.get_active_contact()
        self.smscampaign.progress_bar()
        self.smscampaign.sms_campaignsubscriber_detail()
        self.smscampaign.get_pending_subscriber()
        self.smscampaign.get_pending_subscriber_update()

        common_sms_campaign_status(self.smscampaign.id, SMS_CAMPAIGN_STATUS.START)
        common_sms_campaign_status(self.smscampaign.id, SMS_CAMPAIGN_STATUS.PAUSE)
        common_sms_campaign_status(self.smscampaign.id, SMS_CAMPAIGN_STATUS.ABORT)
        common_sms_campaign_status(self.smscampaign.id, SMS_CAMPAIGN_STATUS.END)

        self.assertEqual(self.smssubscriber.sms_campaign, self.smscampaign)