'Test that only the right token is authorized'

@ddt.data(*AUTH_ATTRS)
def test_authorization(self, auth_attr):

    auth_list = ['Wrong    token-type-obviously', 'Bearer    wrong    token    format', 'Bearer    wrong-token', 'Bearer', 'Bearer    hfbhfbfwq398248fnid939rh3489fh39nd4m34r9']
    for auth in auth_list:
        resp = self.client.get(self.list_url_master_course, {}, HTTP_AUTHORIZATION=auth)
        self.assertEqual(resp.status_code, status.HTTP_401_UNAUTHORIZED)
    resp = self.client.get(self.list_url_master_course, {}, HTTP_AUTHORIZATION=getattr(self, auth_attr))
    self.assertEqual(resp.status_code, status.HTTP_200_OK)
