'Makes a call to the Team API at the given url with method and data.
If a user is specified in kwargs, that user is first logged in.'

def make_call(self, url, expected_status=200, method='get', data=None, content_type=None, **kwargs):

    user = kwargs.pop('user', 'student_enrolled_not_on_team')
    if user:
        self.login(user)
    func = getattr(self.client, method)
    if content_type:
        response = func(url, data=data, content_type=content_type)
    else:
        response = func(url, data=data)
    self.assertEqual(expected_status, response.status_code, msg='Expected    status    {expected}    but    got    {actual}:    {content}'.format(expected=expected_status, actual=response.status_code, content=response.content))
    if (expected_status == 200):
        return json.loads(response.content)
    else:
        return response
