'Test Update Coupon Info Scenarios. Handle all the HttpResponses return by update_coupon view'

def test_update_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)
    data = {'coupon_id': coupon.id, 'code': 'AS452', 'discount': '10', 'description': 'updated_description', 'course_id': coupon.course_id.to_deprecated_string()}
    update_coupon_url = reverse('update_coupon', kwargs={'course_id': self.course.id.to_deprecated_string()})
    response = self.client.post(update_coupon_url, data=data)
    self.assertIn('coupon    with    the    coupon    id    ({coupon_id})    updated    Successfully'.format(coupon_id=coupon.id), response.content)
    response = self.client.post(self.url)
    self.assertIn('<td>updated_description</td>', response.content)
    data['coupon_id'] = 1000
    response = self.client.post(update_coupon_url, data=data)
    self.assertIn('coupon    with    the    coupon    id    ({coupon_id})    DoesNotExist'.format(coupon_id=1000), response.content)
    data['coupon_id'] = ''
    response = self.client.post(update_coupon_url, data=data)
    self.assertIn('coupon    id    not    found', response.content)
