def report_context(self): context = super(DomainForwardingRepeatRecords, self).report_context total = get_repeat_record_count(self.domain, self.repeater_id) total_cancel = get_pending_repeat_record_count(self.domain, self.repeater_id) total_requeue = get_cancelled_repeat_record_count( self.domain, self.repeater_id) form_query_string = self.request.GET.urlencode() form_query_string_requeue = _change_record_state( form_query_string, 'CANCELLED') form_query_string_cancellable = _change_record_state( form_query_string, 'PENDING') context.update( email_bulk_payload_form=EmailBulkPayload(domain=self.domain), total=total, total_cancel=total_cancel, total_requeue=total_requeue, form_query_string=form_query_string, form_query_string_cancellable=form_query_string_cancellable, form_query_string_requeue=form_query_string_requeue, ) return context
def report_context(self): context = super(DomainForwardingRepeatRecords, self).report_context total = get_repeat_record_count(self.domain, self.repeater_id) total_pending = get_pending_repeat_record_count( self.domain, self.repeater_id) total_cancelled = get_cancelled_repeat_record_count( self.domain, self.repeater_id) form_query_string = self.request.GET.urlencode() form_query_string_cancelled = _change_record_state( self.request.GET, 'CANCELLED').urlencode() form_query_string_pending = _change_record_state( self.request.GET, 'PENDING').urlencode() context.update( total=total, total_pending=total_pending, total_cancelled=total_cancelled, form_query_string=form_query_string, form_query_string_pending=form_query_string_pending, form_query_string_cancelled=form_query_string_cancelled, ) return context
def test_get_pending_repeat_record_count(self): count = get_pending_repeat_record_count(self.domain, self.repeater_id) self.assertEqual(count, 2)