@mock.patch("h.accounts.models.User.get_by_username")
def test_make_staff_sets_staff_to_True_if_True(get_by_username):
    fred = mock.Mock()
    fred.staff = True
    get_by_username.return_value = fred

    accounts.make_staff("fred")

    assert fred.staff is True
If .staff is True it should just do nothing.
dataset/ETHPy150Open hypothesis/h/h/accounts/test/__init___test.py/test_make_staff_sets_staff_to_True_if_True