def demo_get(
        username, url_base, json_fields,
        expected_rows=None, **kwargs):
    from django.conf import settings
    case = HttpQuery(username, url_base, json_fields,
                     expected_rows, kwargs)
    # Django test client does not like future pseudo-unicode strings
    # See #870
    url = str(settings.SITE.buildurl(case.url_base, **case.kwargs))
    # print(20160329, url)
    if True:
        msg = 'Using remote authentication, but no user credentials found.'
        try:
            response = self.client.get(url)
            raise Exception("Expected '%s'" % msg)
        except Exception:
            pass
            #~ self.tc.assertEqual(str(e),msg)
            #~ if str(e) != msg:
                    #~ raise Exception("Expected %r but got %r" % (msg,str(e)))

    response = test_client.get(url, REMOTE_USER=str('foo'))
    if response.status_code != 403:
        raise Exception(
            "Status code %s other than 403 for anonymous on GET %s" % (
                response.status_code, url))

    response = test_client.get(url, REMOTE_USER=str(case.username))
    # try:
    if True:
        user = settings.SITE.user_model.objects.get(
            username=case.username)
        result = check_json_result(
            response, case.json_fields,
            "GET %s for user %s" % (url, user))

        num = case.expected_rows
        if num is not None:
            if not isinstance(num, tuple):
                num = [num]
            if num not in result['count']:
                msg = "%s got %s rows instead of %s" % (
                    url, result['count'], num)
                raise Exception(msg)

    # except Exception as e:
    #     print("%s:\n%s" % (url, e))
    #     raise
dataset/ETHPy150Open lsaffre/lino/lino/api/doctest.py/demo_get/swapped operands of `not in`