Example #1
0
def test_staff_index_when_one_staff(User):
    request = DummyRequest()
    User.staff_members.return_value = [Mock(username="******")]

    result = views.staff_index(request)

    assert result["staff"] == ["fred"]
Example #2
0
    def test_context_contains_staff_usernames(self, pyramid_request):
        result = views.staff_index(pyramid_request)

        assert set(result["staff"]) == set([
            "acct:[email protected]", "acct:[email protected]",
            "acct:[email protected]"
        ])
Example #3
0
def test_staff_index_when_no_staff(User):
    request = DummyRequest()
    User.staff_members.return_value = []

    result = views.staff_index(request)

    assert result["staff"] == []
Example #4
0
    def test_context_contains_staff_usernames(self, pyramid_request):
        result = views.staff_index(pyramid_request)

        assert set(result["staff"]) == set([
            "acct:[email protected]",
            "acct:[email protected]",
            "acct:[email protected]"
        ])
Example #5
0
    def test_context_contains_staff_usernames(self):
        request = DummyRequest()

        result = views.staff_index(request)

        assert set(result["staff"]) == set(["agnos", "bojan", "cristof"])
Example #6
0
    def test_when_no_staff(self):
        request = DummyRequest()

        result = views.staff_index(request)

        assert result["staff"] == []
Example #7
0
    def test_context_contains_staff_usernames(self):
        request = DummyRequest()

        result = views.staff_index(request)

        assert set(result["staff"]) == set(["agnos", "bojan", "cristof"])
Example #8
0
    def test_when_no_staff(self):
        request = DummyRequest()

        result = views.staff_index(request)

        assert result["staff"] == []
Example #9
0
    def test_when_no_staff(self, pyramid_request):
        result = views.staff_index(pyramid_request)

        assert result["staff"] == []
Example #10
0
    def test_context_contains_staff_usernames(self, pyramid_request):
        result = views.staff_index(pyramid_request)

        assert set(result["staff"]) == set(["agnos", "bojan", "cristof"])
Example #11
0
    def test_when_no_staff(self, pyramid_request):
        result = views.staff_index(pyramid_request)

        assert result["staff"] == []