mirror of
https://github.com/pretix/pretix.git
synced 2026-05-04 15:04:03 +00:00
Order API: Add magic value to keep current file
This commit is contained in:
@@ -4951,6 +4951,7 @@ def test_position_update_question_handling(token_client, organizer, event, order
|
||||
)
|
||||
assert r.status_code == 201
|
||||
file_id_png = r.data['id']
|
||||
|
||||
payload = {
|
||||
'answers': [
|
||||
{
|
||||
@@ -4971,3 +4972,24 @@ def test_position_update_question_handling(token_client, organizer, event, order
|
||||
answ = op.answers.get()
|
||||
assert answ.file
|
||||
assert answ.answer.startswith("file://")
|
||||
|
||||
payload = {
|
||||
'answers': [
|
||||
{
|
||||
"question": question.id,
|
||||
"answer": "file:keep"
|
||||
}
|
||||
]
|
||||
}
|
||||
question.type = Question.TYPE_FILE
|
||||
question.save()
|
||||
resp = token_client.patch(
|
||||
'/api/v1/organizers/{}/events/{}/orderpositions/{}/'.format(
|
||||
organizer.slug, event.slug, op.pk
|
||||
), format='json', data=payload
|
||||
)
|
||||
assert resp.status_code == 200
|
||||
with scopes_disabled():
|
||||
answ = op.answers.get()
|
||||
assert answ.file
|
||||
assert answ.answer.startswith("file://")
|
||||
|
||||
Reference in New Issue
Block a user