'Assert that the Django rest framework does not interpret basic auth
headers for views exposed to anonymous users as an attempt to authenticate.'

def assertAuthDisabled(self, method, uri):

    basic_auth_header = ('Basic    ' + base64.b64encode('username:password'))
    response = getattr(self.client, method)(uri, HTTP_AUTHORIZATION=basic_auth_header)
    self.assertNotEqual(response.status_code, 403)
