def METHOD_NAME(self):
    vs = voucher.VoucherSetFactory(count=10)
    v = vs.vouchers.first()
    view = views.VoucherUpdateView.as_view()
    request = RequestFactory().get("/")
    response = view(request, pk=v.pk)
    assert response.status_code == 302
    assert response.url == reverse(
        "dashboard:voucher-set-update", kwargs={"pk": vs.pk}
    )
    assert [(m.level_tag, str(m.message)) for m in get_messages(request)][0] == (
        "warning",
        "The voucher can only be edited as part of its set",
    )
    data = {
        "code": v.code,
        "name": "New name",
        "start_datetime": v.start_datetime,
        "end_datetime": v.end_datetime,
        "usage": v.usage,
        "offers": [v.offers],
    }
    request = RequestFactory().post("/", data=data)
    response = view(request, pk=v.pk)
    assert response.status_code == 302
    assert response.url == reverse(
        "dashboard:voucher-set-update", kwargs={"pk": vs.pk}
    )
    assert [(m.level_tag, str(m.message)) for m in get_messages(request)][0] == (
        "warning",
        "The voucher can only be edited as part of its set",
    )
    v.refresh_from_db()
    assert v.name != "New name"