'Test Delete Coupon Scenarios. Handle all the HttpResponses return by remove_coupon view'

def test_delete_coupon(self):

    coupon = Coupon(code='AS452', description='asdsadsa', course_id=self.course.id.to_deprecated_string(), percentage_discount=10, created_by=self.instructor)
    coupon.save()
    response = self.client.post(self.url)
    self.assertIn('<td>AS452</td>', response.content)
    delete_coupon_url = reverse('remove_coupon', kwargs={'course_id': self.course.id.to_deprecated_string()})
    response = self.client.post(delete_coupon_url, {'id': coupon.id})
    self.assertIn('coupon    with    the    coupon    id    ({coupon_id})    updated    successfully'.format(coupon_id=coupon.id), response.content)
    coupon.is_active = False
    coupon.save()
    response = self.client.post(delete_coupon_url, {'id': coupon.id})
    self.assertIn('coupon    with    the    coupon    id    ({coupon_id})    is    already    inactive'.format(coupon_id=coupon.id), response.content)
    response = self.client.post(delete_coupon_url, {'id': 24454})
    self.assertIn('coupon    with    the    coupon    id    ({coupon_id})    DoesNotExist'.format(coupon_id=24454), response.content)
    response = self.client.post(delete_coupon_url, {'id': ''})
    self.assertIn('coupon    id    is    None', response.content)
