Beispiel #1
0
def test_admins_index_when_no_admins(User):
    request = DummyRequest()
    User.admins.return_value = []

    result = views.admins_index(request)

    assert result["admin_users"] == []
Beispiel #2
0
def test_admins_index_when_one_admin(User):
    request = DummyRequest()
    User.admins.return_value = [Mock(username="******")]

    result = views.admins_index(request)

    assert result["admin_users"] == ["fred"]
Beispiel #3
0
def test_admins_index_when_one_admin(User):
    request = DummyRequest()
    User.admins.return_value = [Mock(username="******")]

    result = views.admins_index(request)

    assert result["admin_users"] == ["fred"]
Beispiel #4
0
    def test_context_contains_admin_usernames(self, pyramid_request):
        result = views.admins_index(pyramid_request)

        assert set(result["admin_users"]) == set([
            "acct:[email protected]", "acct:[email protected]",
            "acct:[email protected]"
        ])
Beispiel #5
0
def test_admins_index_when_no_admins(User):
    request = DummyRequest()
    User.admins.return_value = []

    result = views.admins_index(request)

    assert result["admin_users"] == []
Beispiel #6
0
    def test_context_contains_admin_usernames(self, pyramid_request):
        result = views.admins_index(pyramid_request)

        assert set(result["admin_users"]) == set([
            "acct:[email protected]",
            "acct:[email protected]",
            "acct:[email protected]"
        ])
Beispiel #7
0
def test_admins_index_when_multiple_admins(User):
    request = DummyRequest()
    User.admins.return_value = [Mock(username="******"),
                                Mock(username="******"),
                                Mock(username="******")]

    result = views.admins_index(request)

    assert result["admin_users"] == ["fred", "bob", "frank"]
Beispiel #8
0
def test_admins_index_when_multiple_admins(User):
    request = DummyRequest()
    User.admins.return_value = [
        Mock(username="******"),
        Mock(username="******"),
        Mock(username="******")
    ]

    result = views.admins_index(request)

    assert result["admin_users"] == ["fred", "bob", "frank"]
Beispiel #9
0
    def test_context_contains_admin_usernames(self):
        request = DummyRequest()

        result = views.admins_index(request)

        assert set(result["admin_users"]) == set(["agnos", "bojan", "cristof"])
Beispiel #10
0
    def test_when_no_admins(self):
        request = DummyRequest()

        result = views.admins_index(request)

        assert result["admin_users"] == []
Beispiel #11
0
    def test_context_contains_admin_usernames(self, pyramid_request):
        result = views.admins_index(pyramid_request)

        assert set(result["admin_users"]) == set(["agnos", "bojan", "cristof"])
Beispiel #12
0
    def test_when_no_admins(self, pyramid_request):
        result = views.admins_index(pyramid_request)

        assert result["admin_users"] == []
Beispiel #13
0
    def test_when_no_admins(self, pyramid_request):
        result = views.admins_index(pyramid_request)

        assert result["admin_users"] == []
Beispiel #14
0
    def test_context_contains_admin_usernames(self, pyramid_request):
        result = views.admins_index(pyramid_request)

        assert set(result["admin_users"]) == set(["agnos", "bojan", "cristof"])