MCPcopy Index your code
hub / github.com/fastapi-users/fastapi-users / test_superuser

Method test_superuser

tests/test_manager.py:147–157  ·  view source on GitHub ↗
(
        self, user_manager: UserManagerMock[UserModel], safe: bool, result: bool
    )

Source from the content-addressed store, hash-verified

145
146 @pytest.mark.parametrize("safe,result", [(True, False), (False, True)])
147 async def test_superuser(
148 self, user_manager: UserManagerMock[UserModel], safe: bool, result: bool
149 ):
150 user = UserCreate(
151 email="lancelot@camelot.b", password="guinevere", is_superuser=True
152 )
153 created_user = await user_manager.create(user, safe)
154 assert isinstance(created_user, UserModel)
155 assert created_user.is_superuser is result
156
157 assert user_manager.on_after_register.called is True
158
159 @pytest.mark.parametrize("safe,result", [(True, True), (False, False)])
160 async def test_is_active(

Callers

nothing calls this directly

Calls 2

UserCreateClass · 0.90
createMethod · 0.45

Tested by

no test coverage detected