def test_admin_index_when_one_admin(admins): admins.return_value = [Mock(username="******")] assert AdminController.index()["admin_users"] == ["fred"]
def test_admin_index_when_multiple_admins(admins_function): admins_function.return_value = [Mock(username="******"), Mock(username="******"), Mock(username="******")] template_data = AdminController.index() assert template_data["admin_users"] == ["fred", "bob", "frank"]
def test_admin_index_when_no_admins(admins): admins.return_value = [] assert AdminController.index()["admin_users"] == []