示例#1
0
def test_nipsa_filter_coerces_userid_to_lowercase(group_service, user):
    user.userid = 'DonkeyNose'

    filter_ = search.nipsa_filter(group_service, user)

    assert {'term': {'user': '******'}} in (
        filter_["bool"]["should"])
示例#2
0
def test_nipsa_filter_group_annotations_not_filtered_for_creator(group_service, user):
    group_service.groupids_created_by.return_value = ['pubid-1', 'pubid-4', 'pubid-3']

    filter_ = search.nipsa_filter(group_service, user)

    assert {'terms': {'group': ['pubid-1', 'pubid-4', 'pubid-3']}} in (
        filter_['bool']['should'])
示例#3
0
文件: search_test.py 项目: soapdog/h
def test_nipsa_filter_group_annotations_not_filtered_for_creator(group_service, user):
    group_service.groupids_created_by.return_value = ['pubid-1', 'pubid-4', 'pubid-3']

    filter_ = search.nipsa_filter(group_service, user)

    assert {'terms': {'group': ['pubid-1', 'pubid-4', 'pubid-3']}} in (
        filter_['bool']['should'])
示例#4
0
文件: search_test.py 项目: soapdog/h
def test_nipsa_filter_coerces_userid_to_lowercase(group_service, user):
    user.userid = 'DonkeyNose'

    filter_ = search.nipsa_filter(group_service, user)

    assert {'term': {'user': '******'}} in (
        filter_["bool"]["should"])
示例#5
0
def test_nipsa_filter_filters_out_nipsad_annotations():
    """nipsa_filter() filters out annotations with "nipsa": True."""
    assert search.nipsa_filter() == {
        "bool": {
            "should": [
                {'not': {'term': {'nipsa': True}}}
            ]
        }
    }
示例#6
0
def test_nipsa_filter_filters_out_nipsad_annotations(group_service):
    """nipsa_filter() filters out annotations with "nipsa": True."""
    assert search.nipsa_filter(group_service) == {
        "bool": {
            "should": [
                {'not': {'term': {'nipsa': True}}},
                {'exists': {'field': 'thread_ids'}},
            ]
        }
    }
示例#7
0
文件: search_test.py 项目: soapdog/h
def test_nipsa_filter_filters_out_nipsad_annotations(group_service):
    """nipsa_filter() filters out annotations with "nipsa": True."""
    assert search.nipsa_filter(group_service) == {
        "bool": {
            "should": [
                {'not': {'term': {'nipsa': True}}},
                {'exists': {'field': 'thread_ids'}},
            ]
        }
    }
示例#8
0
def test_nipsa_filter_filters_out_nipsad_annotations():
    """nipsa_filter() filters out annotations with "nipsa": True."""
    assert search.nipsa_filter() == {
        "bool": {
            "should": [{
                'not': {
                    'term': {
                        'nipsa': True
                    }
                }
            }]
        }
    }
示例#9
0
def test_nipsa_filter_users_own_annotations_are_not_filtered():
    filter_ = search.nipsa_filter(userid="fred")

    assert {'term': {'user': '******'}} in (filter_["bool"]["should"])
示例#10
0
def test_nipsa_filter_coerces_userid_to_lowercase():
    filter_ = search.nipsa_filter(userid="DonkeyNose")

    assert {'term': {'user': '******'}} in (filter_["bool"]["should"])
示例#11
0
def test_nipsa_filter_users_own_annotations_are_not_filtered():
    filter_ = search.nipsa_filter(userid="fred")

    assert {'term': {'user': '******'}} in (
        filter_["bool"]["should"])
示例#12
0
def test_nipsa_filter_users_own_annotations_are_not_filtered(group_service, user):
    filter_ = search.nipsa_filter(group_service, user)

    assert {'term': {'user': '******'}} in (
        filter_["bool"]["should"])
示例#13
0
文件: search_test.py 项目: nlisgo/h
def test_nipsa_filter_coerces_userid_to_lowercase():
    filter_ = search.nipsa_filter(userid="DonkeyNose")

    assert {'term': {'user': '******'}} in (
        filter_["bool"]["should"])
示例#14
0
文件: search_test.py 项目: soapdog/h
def test_nipsa_filter_users_own_annotations_are_not_filtered(group_service, user):
    filter_ = search.nipsa_filter(group_service, user)

    assert {'term': {'user': '******'}} in (
        filter_["bool"]["should"])