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"]
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]" ])
def test_staff_index_when_no_staff(User): request = DummyRequest() User.staff_members.return_value = [] result = views.staff_index(request) assert result["staff"] == []
def test_context_contains_staff_usernames(self): request = DummyRequest() result = views.staff_index(request) assert set(result["staff"]) == set(["agnos", "bojan", "cristof"])
def test_when_no_staff(self): request = DummyRequest() result = views.staff_index(request) assert result["staff"] == []
def test_when_no_staff(self, pyramid_request): result = views.staff_index(pyramid_request) assert result["staff"] == []
def test_context_contains_staff_usernames(self, pyramid_request): result = views.staff_index(pyramid_request) assert set(result["staff"]) == set(["agnos", "bojan", "cristof"])