Пример #1
0
def test_modife(app_r, role):
    role_new = Role(id=role.id, name="QA_modife", type="Oksana_modife", level=8, book=2)
    response = app_r.modife_object(role_new)
    # Verification
    assert response.status_code == 200
    assert response.json() == role_new.get_dict_with_id()

    response = app_r.get_object(role).json()
    # Verification
    assert response["level"] == 8
    assert response["book"] == 2
Пример #2
0
def test_modife_empty(app_r, role):
    role_new = Role(id=role.id, name="", type="")
    response = app_r.modife_object(role_new)
    # Verification
    assert response.status_code == 400
    assert role_new.get_dict_with_id() not in app_r.get_objects()