Skip to content

Commit 5a5609c

Browse files
author
setiawanisasi
committed
fix: load_policy first before use
1 parent ae31ff9 commit 5a5609c

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

tests/conftest.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,4 +63,6 @@ async def enforcer(
6363
db: Database, setup_policies, casbin_rule_table: Table, model_conf_path
6464
) -> Enforcer:
6565
adapter = DatabasesAdapter(db, table=casbin_rule_table)
66-
return Enforcer(model_conf_path, adapter)
66+
enforcer = Enforcer(model_conf_path, adapter)
67+
await enforcer.load_policy()
68+
return enforcer

0 commit comments

Comments
 (0)