Order import: Allow to assign a customer

This commit is contained in:
Raphael Michel
2023-06-27 17:07:30 +02:00
parent ccfdd364a3
commit 456bee7efa
2 changed files with 49 additions and 2 deletions

View File

@@ -308,6 +308,25 @@ def test_import_attendee_email(user, event, item):
assert OrderPosition.objects.filter(attendee_email__isnull=True).count() == 1
@pytest.mark.django_db
@scopes_disabled()
def test_import_customer(user, event, item):
event.organizer.settings.customer_accounts = True
settings = dict(DEFAULT_SETTINGS)
settings['item'] = 'static:{}'.format(item.pk)
settings['customer'] = 'csv:C'
c = event.organizer.customers.create(
email="daniel@example.org",
)
event.organizer.customers.create(
email="schneider@example.org",
)
import_orders.apply(
args=(event.pk, inputfile_factory().id, settings, 'en', user.pk)
)
assert c.orders.count() == 1
@pytest.mark.django_db
@scopes_disabled()
def test_import_attendee_email_invalid(user, event, item):