Ejemplo n.º 1
0
def test_nipsa_index_with_multiple_nipsad_users(nipsa):
    nipsa.index.return_value = [
        "acct:[email protected]", "acct:[email protected]",
        "acct:[email protected]"]

    assert views.nipsa_index(DummyRequest()) == {
        "usernames": ["kiki", "ursula", "osono"]}
Ejemplo n.º 2
0
    def test_lists_flagged_usernames(self, pyramid_request):
        result = views.nipsa_index(pyramid_request)

        assert set(result['userids']) == set([
            'acct:[email protected]',
            'acct:[email protected]',
            'acct:[email protected]',
        ])
Ejemplo n.º 3
0
    def test_lists_flagged_usernames_no_results(self, nipsa_service, pyramid_request):
        nipsa_service.flagged = set([])

        result = views.nipsa_index(pyramid_request)

        assert result["userids"] == []
Ejemplo n.º 4
0
    def test_lists_flagged_usernames(self, pyramid_request):
        result = views.nipsa_index(pyramid_request)

        assert set(result['usernames']) == set(['kiki', 'ursula', 'osono'])
Ejemplo n.º 5
0
def test_nipsa_index_with_one_nipsad_users(nipsa):
    nipsa.index.return_value = ["acct:[email protected]"]

    assert views.nipsa_index(DummyRequest()) == {"usernames": ["kiki"]}
Ejemplo n.º 6
0
def test_nipsa_index_with_no_nipsad_users(nipsa):
    nipsa.index.return_value = []

    assert views.nipsa_index(DummyRequest()) == {"usernames": []}