Exemple #1
0
def test_role_update_opt_out_future(role_dict):
    r = Role(**role_dict)
    future_dt = datetime.datetime.now() + datetime.timedelta(days=1)
    r.opt_out = {"expire": future_dt.timestamp()}
    r._update_opt_out()
    # opt out should not have been touched since it is not expired
    assert r.opt_out == {"expire": future_dt.timestamp()}
Exemple #2
0
def test_role_update_opt_out(role_dict):
    r = Role(**role_dict)
    recent_dt = datetime.datetime.now() - datetime.timedelta(days=1)
    r.opt_out = {"expire": recent_dt.timestamp()}
    r._update_opt_out()
    assert r.opt_out == {}