'Test that checks the redeem count in the instructor_dashboard coupon section'

def test_coupon_redeem_count_in_ecommerce_section(self):

    coupon = Coupon(code='test_code', description='test_description', course_id=self.course.id, percentage_discount='10', created_by=self.instructor, is_active=True)
    coupon.save()
    CourseFinanceAdminRole(self.course.id).add_users(self.instructor)
    PaidCourseRegistration.add_to_order(self.cart, self.course.id)
    resp = self.client.post(reverse('shoppingcart.views.use_code', is_dashboard_endpoint=False), {'code': coupon.code})
    self.assertEqual(resp.status_code, 200)
    instructor_dashboard = reverse('instructor_dashboard', kwargs={'course_id': self.course.id.to_deprecated_string()}, is_dashboard_endpoint=False)
    resp = self.client.get(instructor_dashboard)
    self.assertEqual(resp.status_code, 200)
    self.assertIn('Number    Redeemed', resp.content)
    self.assertIn('<td>0</td>', resp.content)
    self.cart.purchase()
    resp = self.client.get(instructor_dashboard)
    self.assertEqual(resp.status_code, 200)
    self.assertIn('Number    Redeemed', resp.content)
    self.assertIn('<td>1</td>', resp.content)
