'Tests for the ensure_valid_course_key decorator.'

@data(('edX/test_course_key/Test_Course', 200), ('garbage:edX+test_course_key+Test_Course', 404))
@unpack
def test_course_key_decorator(self, course_key, status_code):

    url = '/import/{course_key}'.format(course_key=course_key)
    resp = self.client.get_html(url)
    self.assertEqual(resp.status_code, status_code)
    url = '/import_status/{course_key}/{filename}'.format(course_key=course_key, filename='xyz.tar.gz')
    resp = self.client.get_html(url)
    self.assertEqual(resp.status_code, status_code)
