'Prepare ecommerce checkout data and assert if the ecommerce link is contained in the response.
Arguments:
is_anonymous(bool): Tell the method to use an anonymous user or the logged in one.
_id(bool): Tell the method to either expect an id in the href or not.'

def assert_enrollment_link_present(self, is_anonymous):

    sku = 'TEST123'
    configuration = CommerceConfiguration.objects.create(checkout_on_ecommerce_service=True)
    course = CourseFactory.create()
    CourseModeFactory(mode_slug=CourseMode.PROFESSIONAL, course_id=course.id, sku=sku, min_price=1)
    if is_anonymous:
        self.client.logout()
    else:
        self.assertTrue(self.client.login(username=self.user.username, password=self.password))
    href = '<a    href="{uri_stem}?sku={sku}"    class="add-to-cart">'.format(uri_stem=configuration.MULTIPLE_ITEMS_BASKET_PAGE_URL, sku=sku)
    response = self.client.get(reverse('about_course', args=[unicode(course.id)]))
    self.assertEqual(response.status_code, 200)
    self.assertIn(href, response.content)
