mirror of
https://github.com/pretix/pretix.git
synced 2026-09-12 16:04:42 +00:00
Event Settings: Make contact_url and imprint_url I18nURLField (Z#23238623) (#6506)
* Event Settings: Make contact_url and imprint_url I18nURLField (Z#23238623) * isort * Update doc/api/resources/events.rst --------- Co-authored-by: Raphael Michel <michel@pretix.eu>
This commit is contained in:
co-authored by
Raphael Michel
parent
edb4069e18
commit
2c15d8b074
@@ -25,6 +25,7 @@ from datetime import datetime
|
||||
import pytest
|
||||
from django.core.files.base import ContentFile
|
||||
from django_scopes import scopes_disabled
|
||||
from i18nfield.strings import LazyI18nString
|
||||
from tests.const import SAMPLE_PNG
|
||||
|
||||
TEST_ORGANIZER_RES = {
|
||||
@@ -165,9 +166,11 @@ def test_patch_settings(token_client, organizer):
|
||||
format='json'
|
||||
)
|
||||
assert resp.status_code == 200
|
||||
assert resp.data['contact_url'] == 'https://example.org/contact'
|
||||
assert resp.data['contact_url'] == {
|
||||
'en': 'https://example.org/contact',
|
||||
}
|
||||
organizer.settings.flush()
|
||||
assert organizer.settings.contact_url == 'https://example.org/contact'
|
||||
assert organizer.settings.contact_url == LazyI18nString('https://example.org/contact')
|
||||
|
||||
resp = token_client.patch(
|
||||
'/api/v1/organizers/{}/settings/'.format(organizer.slug),
|
||||
|
||||
Reference in New Issue
Block a user