コード例 #1
0
def test_role_mark_inactive(mock_store, role_dict):
    r = Role(**role_dict)
    r.active = True
    r.mark_inactive()
    assert not r.active
    mock_store.assert_called_once()
    assert mock_store.call_args[1]["fields"] == ["Active"]
コード例 #2
0
def test_role_mark_inactive_no_store(mock_store, role_dict):
    r = Role(**role_dict)
    r.active = True
    r.mark_inactive(store=False)
    assert not r.active
    mock_store.assert_not_called()