'Verify unenrolled staff is redirected to correct url.'

@ddt.data(({'enroll': 'Enroll'}, True), ({'dont_enroll': "Don't    enroll"}, False))
@ddt.unpack
def test_enroll_staff_redirection(self, data, enrollment):

    self._create_global_staff_user()
    (courseware_url, enroll_url) = self._create_url_for_enroll_staff()
    response = self.client.post(enroll_url, data=data, follow=True)
    self.assertEqual(response.status_code, 200)
    self.assertIn(302, response.redirect_chain[0])
    self.assertEqual(len(response.redirect_chain), 1)
    if enrollment:
        self.assertRedirects(response, courseware_url)
    else:
        self.assertRedirects(response, '/courses/{}/about'.format(unicode(self.course_key)))
