@mock.patch("h.accounts.models.User.get_by_username")
def test_make_admin_sets_admin_to_True_if_False(get_by_username):
    fred = mock.Mock()
    fred.admin = False
    get_by_username.return_value = fred

    accounts.make_admin("fred")

    assert fred.admin is True
It should set .admin to True if it was False.
dataset/ETHPy150Open hypothesis/h/h/accounts/test/__init___test.py/test_make_admin_sets_admin_to_True_if_False