'Ensure that the view does not attempt to create a basket for closed
courses.'

def test_closed_course(self):

    self.course.enrollment_end = (datetime.now(pytz.UTC) - timedelta(days=1))
    modulestore().update_item(self.course, self.user.id)
    with mock_create_basket(expect_called=False):
        self.assertEqual(self._post_to_view().status_code, 406)
